[Bug target/43871] New: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes

marcus at jet dot franken dot de gcc-bugzilla@gcc.gnu.org
Fri Apr 23 19:01:00 GMT 2010


my kernel does not boot anymore on a ppc970 (powermac g5) due to an illegal
instruction caused by gcc 4.5

research showed that the DI bswap64 operation is optimized to ldbrx even on
power4, but causes an sigill there.

gcc -m64 -c -O2 -mcpu=power4 -mtune=cell
gcc/testsuite/gcc.target/powerpc/optimize-bswapdi-3.c ; objdump -d
optimize-bswapdi-3.o
0000000000000000 <.swap64_load>:
   0:   7c 00 1c 28     .long 0x7c001c28
   4:   7c 03 03 78     mr      r3,r0
   8:   4e 80 00 20     blr


while:

gcc -m64 -c -O2 -mcpu=power4
gcc/testsuite/gcc.target/powerpc/optimize-bswapdi-3.c ; objdump -d
optimize-bswapdi-3.o
0000000000000000 <.swap64_load>:
   0:   39 20 00 04     li      r9,4
   4:   7c 00 1c 2c     lwbrx   r0,0,r3
   8:   7d 69 1c 2c     lwbrx   r11,r9,r3
   c:   79 6a 07 c6     rldicr  r10,r11,32,31
  10:   7d 4a 03 78     or      r10,r10,r0
  14:   7d 43 53 78     mr      r3,r10
  18:   4e 80 00 20     blr


-mcpu=power4 -mtune=cell should not start to emit opcodes invalid on power4.

I think the bswap64 emitter logic in config/rs6000/rs6000.md is incorrect


-- 
           Summary: -mcpu=power4 -mtune=cell emits power7/cell-only opcodes
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marcus at jet dot franken dot de
 GCC build triplet: powerpc-unknown-linux-gnu
  GCC host triplet: powerpc-unknown-linux-gnu
GCC target triplet: powerpc-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43871



More information about the Gcc-bugs mailing list