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


In message <Pine.LNX.4.44.0307302249500.32603-100000@ops2.one-point.com>, Jeff 
Sturm writes:
 >This is excellent.  Java emits tons of useless null pointer checks.
Yup.  I know.

[ ... ]
 >Somehow the RTL optimizers never caught on to this.
Odd.  We've got a pass do do this at the RTL level and from the structure
of your code I'd expect it to remove the useless check.  Very odd.

In fact, the RTL optimizer catches cases that we currently do not
(see 20030730-2.c).  However, once we deal with the NOP_EXPR issues
in a sane way I'd expect the tree version to be as or more effective
than the RTL version (not to mention more efficient).

 >A related question came up just the other day on the java list.  There are
 >often-called functions (e.g. allocators) in libgcj that cannot return
 >null.  Is there a good way to tell the tree optimizers about these, to
 >eliminate even more useless null pointer checks?
I don't know. 
jeff


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