This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Remove useless null pointer checks
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Diego Novillo <dnovillo at redhat dot com>,Andrew Haley <aph at redhat dot com>,Jeff Law <law at redhat dot com>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 31 Jul 2003 13:24:49 -0400
- Subject: Re: [tree-ssa] Remove useless null pointer checks
- References: <Pine.LNX.4.44.0307311248480.13833-100000@ops2.one-point.com>
On Thursday, July 31, 2003, at 1:15 PM, Jeff Sturm wrote:
On 31 Jul 2003, Diego Novillo wrote:
On Thu, 2003-07-31 at 12:43, Jeff Sturm wrote:
On Thu, 31 Jul 2003, Andrew Haley wrote:
We need a way to mark such an attribute in Java source. We don't
have
an attribute syntax and we want to stay Java compatible. Stylized
comments, perhaps?
I was thinking primarily of library functions like _Jv_AllocObject.
Since
they are declared in the frontend, we can assign any attributes we
like.
C++'s new() operator could be similarly marked, right?
Probably. The two interesting things about "new" memory are that it
cannot alias anything and cannot be null. For the former we could set
the
"malloc" attribute of the call (though gcj doesn't do that currently).
Points-to analysis (will be, i haven't gotten to it yet, but the
support is there) using the malloc attribute to discover which
functions are malloc like functions that return new memory. This will
in turn, enable anything else to know that the variables in question
don't alias anything at that point.
Would it be worthwhile to express this in GIMPLE, i.e. NEW_EXPR?
Not really, it can be discovered without a new expression.
Jeff