Comment 7 for bug 926855

Revision history for this message
Asa Sandahl (asa-sandahl) wrote :

This ticket appears to be the same as:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52294.
a case where gcc generates a cbz instruction that ends up trying to reach too far.

Attaching the assembly file mp.s generated with:

asa-san@ursa4:~/bugs/mp$ /scratch/asa-san/cbuild/slaves/ursa4/gcc-linaro-4.6-2012.01/gcc-binary/bin/gcc -c -o mp.o mp.c -O3 -funroll-loops -save-temps -dp
mp.s: Assembler messages:
mp.s:116: Error: branch out of range
mp.s:343: Error: branch out of range

The patch by Richard Earnshaw affects the pattern *thumb2_shiftsi3_short in the backend.
Looking into mp.s, there are a lot of instructions that were generated from this pattern by the compiler.
lsls r3, r3, #2 @ 426 *thumb2_shiftsi3_short [length = 2]

The patch will become availabel in gcc-linaro-4.6 on the nextmerge from FSF trunk. and that should solve this issue.