Incorrect assembly code is generated for symbol+constant expressions that are generated as a result of constant propagation. Assembly sample: lduh [%o0+%lo(tab)+2], %o0 The last instruction is really dubious, adding a cnstant outside the lo() expression. The system assembler rightly complains, but the GNU assembler (version 2.13.1) silently ignores the +2. (I report that bug separately.) What makes this bug really serious is that the GNU assembler misses the incorrect assembly syntax. Release: 3.2.1 Environment: System: SunOS bob.swox.se 5.7 Generic sun4u sparc SUNW,Ultra-60 Architecture: sun4 host: sparc-sun-solaris2.7 build: sparc-sun-solaris2.7 target: sparc-sun-solaris2.7 configured with: /u/gcc/gcc-3.2.1/configure --enable-languages=c,c++ How-To-Repeat: Compilation command: gcc -O -m64 ~/tco.c This is tco.c: unsigned short tab[] = { 0xbad, 0xcafe }; int foo () { int n = 1; return tab[n]; } int main () { if (foo () != 0xcafe) abort (); return 0; }
State-Changed-From-To: open->feedback State-Changed-Why: I can't reproduce the problem with the same configuration as yours. I have lduh [%o0+2], %o0 in the assembly file.
Eric, this report has been awaiting feedback for 3 months. Should it be closed? Thanks, Dara
No feedback for three months.