This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [gfortran] Fix NULL reference types.


Daniel Jacobowitz wrote:

On Thu, Aug 19, 2004 at 01:54:53PM -0400, Richard Kenner wrote:


I suppose that we could provide the same information I wanted to convey with REFERENCE_TYPE to the optimizer in some other way: a bit on VAR_DECLs, PARM_DECLs, FIELD_DECLs, etc. that says "never NULL".

And INDIRECT_REF, which is somewhat of the harder one.  That's why I
think types are the best approach.

I do think that we should find some way to give this information to the optimizers.

The other issue is when we know that an indirect reference can't trap, such
as the CHAIN reference.



I suspect we know that Fortran's reference types can't trap if they are
non-NULL, also. That might be nice to represent also.


This is true in C++, too: a read/write through a reference will never trap in a valid C++ program.

Daniel's suggestion about range-information is pleasingly general, as long as the optimizers know that a pointer being "not 0" is a really special case -- much more interesting that it being "not 0xafeaf3ac" for example.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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