From owner-freebsd-current@FreeBSD.ORG Tue Mar 13 12:33:14 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D814116A403 for ; Tue, 13 Mar 2007 12:33:14 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.174]) by mx1.freebsd.org (Postfix) with ESMTP id 6699F13C45D for ; Tue, 13 Mar 2007 12:33:14 +0000 (UTC) (envelope-from max@love2party.net) Received: from [88.66.11.22] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis), id 0ML2xA-1HR6Bk3A0m-000211; Tue, 13 Mar 2007 13:33:13 +0100 From: Max Laier Organization: FreeBSD To: freebsd-current@freebsd.org Date: Tue, 13 Mar 2007 13:33:01 +0100 User-Agent: KMail/1.9.5 References: <20070313121106.GA96293@nagual.pp.ru> In-Reply-To: <20070313121106.GA96293@nagual.pp.ru> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1427497.Emh7oR0LCp"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200703131333.11692.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1/yowmm+uYP0i9qRRiMh8FmT4bdTZpE0OEz3xg 0SGuday1WC1j9QbPny62iz8cM7fipc/C1yCb/St+s14mg/CgAV vkXw5l0OakG3P+Hg35AGg== Cc: Subject: Re: Bad gcc -O optimization cause core dump. What to do? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2007 12:33:14 -0000 --nextPart1427497.Emh7oR0LCp Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 13 March 2007 13:11, Andrey Chernov wrote: > Copy the segment below to the file a.c > ---------------------- cut me here --------------------- > #include > > main() { > printf("%s\n", NULL); > } > ---------------------- cut me here --------------------- > Compile first as > cc a.c > ./a.out > got > (null) > Then compile as > cc -O a.c > ./a.out > got core dump. =2E.. > 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 =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart1427497.Emh7oR0LCp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBF9poHXyyEoT62BG0RAqPwAJ9OFBUGwQqZcagQU4Aji8kHy2F6wQCcCHRz gOPehzSH5fw+bsYLAsmrS7A= =hKZl -----END PGP SIGNATURE----- --nextPart1427497.Emh7oR0LCp--