Date: Tue, 13 Mar 2007 16:08:05 +0300 From: Andrey Chernov <ache@freebsd.org> To: Max Laier <max@love2party.net> Cc: freebsd-current@freebsd.org Subject: Re: Bad gcc -O optimization cause core dump. What to do? Message-ID: <20070313130805.GA97256@nagual.pp.ru> In-Reply-To: <200703131333.11692.max@love2party.net> References: <20070313121106.GA96293@nagual.pp.ru> <200703131333.11692.max@love2party.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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: http://www.ciselant.de/projects/gcc_printf/gcc_printf.html 3.1
So, treated as "not a bug" by gcc people.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15685
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? ;)
--
http://ache.pp.ru/
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)
iD8DBQFF9qI1Vg5YK5ZEdN0RAl82AJ95U7KdgA+82lri/Crrsm3jBAaSFACfcEs9
1B4IJqF0sTeSFMyiXNiRum8=
=8sZS
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070313130805.GA97256>
