This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, libgfortran] PR32611 Print sign of negative zero
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: Brooks Moses <brooks dot moses at codesourcery dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Jul 2007 20:44:33 -0700
- Subject: Re: [patch, libgfortran] PR32611 Print sign of negative zero
- References: <4691C8D6.7050703@verizon.net> <4691F8BD.1090200@codesourcery.com> <4692F5A8.5010003@verizon.net>
On Mon, Jul 09, 2007 at 07:57:44PM -0700, Jerry DeLisle wrote:
> Brooks Moses wrote:
> >Jerry DeLisle wrote:
> >>The attached patch provides a solution to this PR.
> >>
> >>The patch uses the signbit function to determine if a zero value is
> >>negative. If so, the sign is emitted. If -std=legacy is specified at
> >>compile time, the negative sign for zero values is not emitted.
> >>
> >>This patch requires -std=legacy to be used to pass NIST. This is
> >>because F77 explicitly prohibits printing the negative sign for zero
> >>values.
> >[...]
> >>OK for trunk?
> >
> >This needs documenting, of course.
> >
> >If you aren't sure of the best place to document it, feel free to create
> >a documentation PR about it and assign it to me, and I'll get to it
> >sometime in August when I have time to think again. :)
> >
> >In particular, note that this changes the meaning of the -std= option.
> >Currently, it only affects what language features are accepted,
> >rejected, or warned about, but any program that compiles will have the
> >same behavior regardless of which -std= option was used to compile it.
> >Your patch changes this, which is IMHO a fairly significant little change.
> >
> Do you think it better to have a separate compiler option like -fsign-zero?
>
> Others please chime in.
I'd rather see -std=f77. For -std=gnu, which is the default behavior,
gfortran should output the minus.
--
Steve