From owner-freebsd-bugs Fri Jul 5 1:30: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D6A837B400 for ; Fri, 5 Jul 2002 01:30:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D33E43E3B for ; Fri, 5 Jul 2002 01:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g658U3JU063502 for ; Fri, 5 Jul 2002 01:30:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g658U3pD063501; Fri, 5 Jul 2002 01:30:03 -0700 (PDT) Date: Fri, 5 Jul 2002 01:30:03 -0700 (PDT) Message-Id: <200207050830.g658U3pD063501@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: bin/40209: __dtoa broken with -O2 or -O3 optimisation Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/40209; it has been noted by GNATS. From: Bruce Evans To: Dan Lukes Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/40209: __dtoa broken with -O2 or -O3 optimisation Date: Fri, 5 Jul 2002 18:32:52 +1000 (EST) On Fri, 5 Jul 2002, Dan Lukes wrote: > >Description: > when you compile libc (or stdlib/strtod.c at least) with -O3 or -O2 > then __dtoa is broken. It cause printf malfunction for [eEfFgG] conversions > and has huge impact on several system utilities > ... > >How-To-Repeat: > compile libc with -O2 or -O3 > compile and execute > printf("'%e' '%f' '%g'\n",(double)10,(double)10,(double)10); > you will get > ':.000000' ':.000000e+00' ':' > > It seems to be gcc's optimization problem only. It could also be a bug in strtod.c. Can you do some more work to isolate the bug? I haven't had time. Single stepping through __dtoa() compiled by the new and old gcc (or even the new gcc with -O and -O2) until different behaviour is reached might work. You could also try a current version of __dtoa (it's in netlib in dtoa.tar.gz and gdtoa.tar.gz; I don't have a URL handy). See also PR 38884. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message