Skip site navigation (1)Skip section navigation (2)
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

--+HP7ph2BbKc20aGI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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?
>=20
> See: http://www.ciselant.de/projects/gcc_printf/gcc_printf.html 3.1

So, treated as "not a bug" by gcc people.=20
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D15685

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

--=20
http://ache.pp.ru/

--+HP7ph2BbKc20aGI
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)

iD8DBQFF9qI1Vg5YK5ZEdN0RAl82AJ95U7KdgA+82lri/Crrsm3jBAaSFACfcEs9
1B4IJqF0sTeSFMyiXNiRum8=
=8sZS
-----END PGP SIGNATURE-----

--+HP7ph2BbKc20aGI--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070313130805.GA97256>