This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Signalling NaNs for floating point initialization?


>>>>> "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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]