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]

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


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