Bad gcc -O optimization cause core dump. What to do?

Andrey Chernov ache at
Tue Mar 13 13:52:53 UTC 2007

On Tue, Mar 13, 2007 at 01:33:01PM +0100, Max Laier wrote:
> > It calls "puts(NULL)" with core dump.
> > It means "printf("%s\n", NULL)" is overoptimized.
> > BTW, things like "printf("1%s\n", NULL)" are not overoptimized.
> > Any ideas? Is it right or needs to be fixed?
> See: 3.1

So, treated as "not a bug" by gcc people.

Sigh. It means printf-coding requires now intrinsic knowledge of gcc 
implementation details because our printf confusingly prints "(null)" too.
Convert printf back to segfault? ;)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-bugs mailing list