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: [tree-ssa] Remove useless null pointer checks


On Thu, 2003-07-31 at 13:26, Jeff Sturm wrote:
> On Thu, 31 Jul 2003, Andrew Haley wrote:
> >  > Would it be worthwhile to express this in GIMPLE, i.e. NEW_EXPR?
> >
> > But there are many standard library methods that cannot return NULL;
> > they either return an object reference or throw an exception.  So
> > NEW_EXPR is too specific.
> 
> True, but for java methods the optimizers could learn a lot from the
> trees.  As in Jeff's my_malloc example.
> 
Still, I'm not sure we really need new tree codes here.  Having the
attribute associated with the FUNCTION_DECL should enough to propagate
it into the CALL_EXPR node and ultimately into the FUNCTION_DECL of the
current function (e.g. if the optimizers determine that the function
can't possibly return NULL).

The FE is where the initial seed of CANT_BE_NULL should be placed.


Diego.


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