This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [3.0, c++, java]: -fomit-frame-pointer IS broken on x86!


On 25 Jun 2001, Manfred Hollstein spake:
> Getting back to my original problem, since "-fomit-frame-pointer" is
> an important flag to achieve acceptable performance of the generated
> code on an x86 target, I find it rather bad, that, while performance
> is better, correct functionality isn't maintained.

I agree; you beat me to this report by a couple of days.

The problem doesn't seem to happen for native builds on
sparc-sun-solaris2.5.1 and alphaev56-dec-osf4.0d.

But building with CFLAGS, BOOT_CFLAGS and CXXFLAGS of -O2
-fomit-frame-pointer -march=i586 -pipe, I get even less far than you;
the stage2 libgcc build keels over with

./xgcc -B./ -B/usr/i586-pc-linux-gnu/bin/ -isystem /usr/i586-pc-linux-gnu/include -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g1 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I/usr/packages/gcc/3.0-testing/gcc -I/usr/packages/gcc/3.0-testing/gcc/. -I/usr/packages/gcc/3.0-testing/gcc/config -I/usr/packages/gcc/3.0-testing/gcc/../include -fexceptions -c /usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `extract_cie_info':
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:219: warning: implicit declaration of function `strlen'
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `execute_stack_op':
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:300: warning: `result' might be used uninitialized in this function
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `uw_frame_state_for':
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:886: warning: implicit declaration of function `memset'
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: In function `uw_install_context_1':
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:1103: warning: implicit declaration of function `memcpy'
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c: At top level:
/usr/packages/gcc/3.0-testing/gcc/unwind-dw2.c:1123: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

No such crash happens in stage1 (built with GCC-2.95.3), so I guess that
the compiler is miscompiling itself in stage2, and that this is a
regression against 2.95.3.

I'm just trying to get a backtrace of that crash; it's decidedly tricky
because of the -fomit-frame-pointer, though :(


(As an aside, I'd be interested to see benchmarks of the effect that
-fomit-frame-pointer has on performance and spills on IA32; I guess it's
quite significant, because of the register pressure reduction, but I
haven't tested it in any way...)

> Another issue is, when "-fomit-frame-pointer" is used alone for
> BOOT_CFLAGS, the generated EH stuff in libgcc is broken; adding

If by `broken' you mean `crashes the compiler' then see above.

> "-mno-push-args" cures this problem. I'm not sure, though, if this
> is just papering over serious problems wrt/ "-fomit-frame-pointer".

I fear that it may be; they affect rather different areas :( and, after
all, -mno-push-args doesn't fix the extra testsuite failures (at least,
it doesn't here).

> I'm hoping that some x86/c++/eh/java experts will take a look at these
> issues.

Likewise.

-- 
`This will immediately become a flamewar.' --- Mark Mitchell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]