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



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