-O3 ?

Mike Frysinger vapier at gentoo.org
Sun May 10 21:10:35 UTC 2009


On Saturday 09 May 2009 20:40:34 Kyle Sallee wrote:
> I tried compiling p7zip with CFLAGS and CXXFLAGS -O3,
> yet it segfaulted when ran.
> However, when compiling it with -Os it works fine.
> I used to expect that problems with optimizations not work
> were the fault of a bug in gcc.
> But is it?
> The problem does not occur when I compile p7zip -O3
> and statically link it with glibc instead.
> I am almost tempted to try to compile it with -O3 and -g
> and run gdb on it.
> But is -O3 optimized code debuggable?

all code is debuggable at some level ... it's just that it makes it harder to 
coordinate machine code to source code as gcc may re-order things on you at 
higher levels.

the best thing to do is try and reduce the test case ... i.e. strip down the 
crashing program so there is less code to look through.

> For now I will use -Os,
> but I wondered if anyone had any information about why -O3
> might be problematic with programs linked with uClibc, please.

havent heard any complaints in Gentoo about using -O3.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20090510/9993a206/attachment.pgp>


More information about the uClibc mailing list