From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Craig Burley Cc: egcs@cygnus.com Subject: Re: Some Haifa scheduler bugs Date: Thu, 04 Sep 1997 11:12:00 -0000 Message-id: <27136.873396735@hurl.cygnus.com> References: <199709041633.MAA20790@melange.gnu.ai.mit.edu> X-SW-Source: 1997-09/msg00150.html In message < 199709041633.MAA20790@melange.gnu.ai.mit.edu >you write: > Good summary. It's not 100% accurate, but it's close enough for this discussion :-) > The way I look at it is, all things being equal, I'd prefer an OS > default to faulting on dereferecing NULL when running generic C code > simply because C code shouldn't be dereferencing NULL. Agreed. HPUX does it backwards -- it defaults to allowing the dereference. However the GCC port passes the magic flags to the linker to turn on faulting by default :-) It's a choice that can be made on a file by file basis -- and with a little work one can even change the magic bit in the executable header to change the behavior of a particular file. I'm less familiar with how this works under aix or with ultrasparcs/solaris, but I assume they both do something relatively reasonable. > not scheduling NULL dereferences. Generally it is better to > default to not doing potentially hurtful optimizations, since users > who know they want optimizations know enough to specify them; That's my general opinion too. > Note that the documentation should be *very* clear that, even if > this option is enabled, it does *not* guarantee that C (or Fortran > etc.) code can then be written that explicitly dereferences NULL. Absolutely. Jeff