This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Some Haifa scheduler bugs
- To: Craig Burley <burley at gnu dot ai dot mit dot edu>
- Subject: Re: Some Haifa scheduler bugs
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Thu, 04 Sep 1997 12:12:15 -0600
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
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