Ian Lance Taylor - Re: Null pointer check elimination (original) (raw)
This is the mail archive of the gcc@gcc.gnu.orgmailing 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] |
- From: Ian Lance Taylor
- To: David Daney
- Cc: Anthony Green , java at gcc dot gnu dot org, Diego Novillo , GCC Mailing List
- Date: 11 Nov 2005 22:53:50 -0800
- Subject: Re: Null pointer check elimination
- References: 1131747852.3205.105.camel@localhost.localdomain<4375835F.6070106@avtrex.com>
David Daney ddaney@avtrex.com writes:
Eventually we should manually mark certain function DECLs as not-returning-null instead of my kludgy test for this one case. I don't know if/when I can get to that. Perhaps somebody else can take it from here.
Looks like all the bits in struct tree_common are used up.
Q: Would it make sense to add a flag to struct tree_decl_common to indicate !zero, set it using an attribute, (and automatically in the java front-end for the cases above), and then test for it in tree-vrp.c similar to below?
This should be done using an attribute, yes. If this is going to be tested frequently enough, it would make sense to add a bit to struct tree_function_decl (I don't see any reason to put it in struct tree_decl-common) (there is currently room for one more bit in tree_function_decl on a machine which requires 16-bit alignment, or 17 more bits on a machine which requires 32-bit alignment). Note that it is also possible to simply store the attribute on DECL_ATTRIBUTES and look it up using lookup_attribute.
Ian
- Follow-Ups:
- Re: Null pointer check elimination
* From: Diego Novillo - Re: Null pointer check elimination
* From: Daniel Berlin
- Re: Null pointer check elimination
- References:
- Re: Null pointer check elimination
* From: David Daney
- Re: Null pointer check elimination
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |