On Sun, Jun 03, 2007 at 02:53:22PM +0100, Gary V. Vaughan wrote: > [[Cc:ing Albert Chin: Albert, why do we need +Onofltacc in the > standard hpux11.23 > flags, when it clearly causes NaN regressions?]]
>From the cc(1) man page: +O[no]fltacc Disable [enable] floating-point optimizations that can result in numerical differences. +Ofltacc is the same as +Ofltacc=strict. +Onofltacc is the same as +Ofltacc=relaxed. So, +Onofltacc disables floating-point optimizations. Seems like the correct decision to me. I'm fine leaving it off if it fixes something but it seems odd. > On 3 Jun 2007, at 01:48, Bruno Haible wrote: > > >Gary V. Vaughan wrote in > > http://lists.gnu.org/archive/html/bug-gnulib/2007-06/msg00005.html > >[For some reason, I can see your last 3 mails on gmane and on > >lists.gnu.org, > >but they don't came into my mailbox. And I have no spam filter.] > > > >>With CC=cc CFLAGS="-z +O2 +Onofltacc +Olit=all +Oentrysched > >>+Odataprefetch \ > >>+Onolimit" LDFLAGS="-Wl,+nodefaultrpath": > >> > >>1.000000 33 > >>test-vasprintf-posix.c:1239: assertion failed > >>/opt/fsw/bash30/bin/bash: line 1: 12683 ABORT instruction (core > >>dumped) EXEEXT='' EXEEXT='' EXEEXT='' srcdir='.' EXEEXT='' > >>srcdir='.' EXEEXT='' srcdir='.' ${dir}$tst > >>FAIL: test-vasprintf-posix > >> > >>With CC=cc CFLAGS="-z +O2 +Olit=all +Oentrysched +Odataprefetch > >>+Onolimit" \ > >>LDFLAGS="-Wl,+nodefaultrpath": > >> > >> -nan 33 > >> -nan 33 > >> PASS: test-vasprintf-posix > > > >This makes it pretty clear that +Onofltacc is the culprit. > > > >>Do you think the test is at fault here? > > > >No; dividing zero by zero *must* give a NaN according to IEEE 754. > >This is > >not the kind of "undefined behaviour" that may be optimized > >randomly by > >the compilers. > > > >>Or is it an hpux compiler bug? > > > >Whether it's an HP-UX compiler bug or whether it's you who are > >willfully > >choosing a non-IEEE-754-compliant compiler by using the option > >+Onofltacc, > >depends on the HP compiler's documentation. I can not judge it by > >the small > >snippet you posted. > > The fact that it breaks this test only on hpux11.23 when the same > flags do > not break it on hpux11.11 and hpux11.00 makes me think it is a > compiler bug. > > >>we've made it a standard flag for compilations on hpux in order for > >>other FLOSS projects to build correctly > > > >It sounds surprising that some projects _require_ a particular > >optimization > >in order to build correctly?! But it any case, I'm more inclined to > >adapt > >source code so that it compiles with default flags, more than for some > >pretty aggressive vendor-specific optimization flags. (Here for HP- > >UX cc > >I consider "cc -Ae" the default.) > > ACK. Thanks for your input. > > Cheers, > Gary > -- > ())_. Email me: [EMAIL PROTECTED] > ( '/ Read my blog: http://blog.azazil.net > / )= ...and my book: http://sources.redhat.com/autobook > `(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912 > > > > -- albert chin ([EMAIL PROTECTED])