This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix NULL reference types.
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: mark at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Aug 2004 19:00:46 +0100
- Subject: Re: [gfortran] Fix NULL reference types.
- Organization: Codesourcery LLC
- References: <10408191754.AA27453@vlsi1.ultra.nyu.edu>
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 don't think it's needed here. Value propagation can determine the
thing being indirected will be non-null -- that'll be something the
propagator has determined, or it'll be a VAR, PARM or FIELD decl with the
non-null bit valid.
You will need it on function return values though. That might be via a
function-pointer, so it needs to be held in the FUNCTION_TYPE node
somewhere.
My understanding is that you'll need the cannot-be-null information at
the boundary of the map that the value propagator works with. That
boundary is global variables, function parameters (of the function being
optimized) and function return values (of non-inlined function it is
calling).
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk