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.


Richard Henderson wrote:

On Wed, Aug 18, 2004 at 02:10:29PM +0100, Paul Brook wrote:


As part of his int_cst sharing work Nathan spotted that gfortran was creating null pointers with REFERENCE_TYPE. Apparently the optimizers [could] assume that a reference type argument is never NULL.



So? We can assume anything, since it would be incorrect to actually
touch such an argument, would it not?


I'm not sure what you're asking.

In C++, it's never valid to have a reference to NULL, and so it is safe for an optimizer to assume that any expression with REFERENCE_TYPE is non-NULL.

Kenner and I discussed this back in 1998:

http://gcc.gnu.org/ml/gcc-bugs/1998-07/msg00040.html

RTH, do you object to Nathan's documentation patch? It would give us an easy way to give the optimizers a little more information.

--
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]