This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Signalling NaNs for floating point initialization?
- To: Thomas dot Koenig at ciw dot uni-karlsruhe dot de (Thomas König)
- Subject: Re: Signalling NaNs for floating point initialization?
- From: Dave Love <d dot love at dl dot ac dot uk>
- Date: 17 Dec 1998 19:02:52 +0000
- Cc: egcs at cygnus dot com
- References: <199812171635.RAA03621@mvmap66.ciw.uni-karlsruhe.de>
>>>>> "TK" == Thomas Koenig <ig25@mvmap66.ciw.uni-karlsruhe.de> writes:
TK> One of the most useful options on an SGI Fortran compiler I've
TK> worked with some years ago was to set all floating point
TK> variables to signalling NaNs upon startup of a program, which
TK> helped a lot in converting old code and in finding quite a few
TK> bugs in new ones.
Indeed, for values of `One of the most useful options' equal to `about
the only good thing', at least as of a couple of years ago...
TK> What do you think about implementing this in g77?
AFAIR, it's on the todo list and definitely a good idea. It's
probably straightforward for scalars by analogy with
-finit-local-zero, but not for arrays; the backend doesn't seem to
provide a facility for initializing aggregates to a repeating bit
pattern other than zeroes (presumably reflecting what assemblers give
you).
Craig had some objection to work on this which I can't recall but
perhaps he can; it was probably to doing only part of the job,
i.e. scalars, which probably aren't the main source of such bugs.