PowerPC `rlwinm' codegen bug

David Edelsohn dje@watson.ibm.com
Tue Jan 5 12:21:00 GMT 1999


	I cannot dupicate this bug on egcs-1.1.1 release on either AIX or
SVR4/eABI:

kitch 36> powerpc-unknown-eabi-gcc -fverbose-asm -O1 -S sarray.i
kitch 37> cat sarray.s
        .file   "sarray.i"

 # rs6000/powerpc options: -msdata=data -G 8
 # GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release) (powerpc-unknown-eabi) compiled by GNU C version egcs-2.90.29 980515 (egcs-1.0.3 release).
 # options passed:  -O1 -fverbose-asm
 # options enabled:  -fdefer-pop -fomit-frame-pointer -fthread-jumps
 # -fpeephole -ffunction-cse -finline -fkeep-static-consts
 # -fpcc-struct-return -fsched-interblock -fsched-spec -fsjlj-exceptions
 # -fcommon -fverbose-asm -fgnu-linker -fargument-alias -mpowerpc
 # -mnew-mnemonics -meabi -mcall-sysv -msdata=data

gcc2_compiled.:
        .section        ".text"
        .align 2
        .globl soffset_decode
        .type    soffset_decode,@function
soffset_decode:
        rlwinm 0,3,0,0xffff
        rlwinm 3,3,21,11,26
        add 3,0,3
        blr
.Lfe1:
        .size    soffset_decode,.Lfe1-soffset_decode
        .ident  "GCC: (GNU) egcs-2.91.60 19981201 (egcs-1.1.1 release)"

The assembly generated above is correct.  The algorithm in GCC to
calculate the mask start is correct.  Whatever compiler you used to build
egcs-1.1.1 for eABI mis-optimized that code or somehow the executable is
corrupted.  I have not heard reports of anyone else experiencing this
problem.  I do not know of any previous releases of GCC or EGCS that would
cause this problem.

David




More information about the Gcc-bugs mailing list