This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran] Fix NULL reference types.
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Paul Brook <paul at nowt dot org>, fortran at gcc dot gnu dot org, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 18 Aug 2004 23:04:20 -0700
- Subject: Re: [gfortran] Fix NULL reference types.
- Organization: CodeSourcery, LLC
- References: <200408181410.29111.paul@nowt.org> <20040818193358.GB28527@redhat.com>
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