This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, Pointer Bounds Checker 14/x] Passes [2/n] IPA passes
- From: Jeff Law <law at redhat dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Oct 2014 13:14:04 -0600
- Subject: Re: [PATCH, Pointer Bounds Checker 14/x] Passes [2/n] IPA passes
- Authentication-results: sourceware.org; auth=none
- References: <20141008185506 dot GB13454 at msticlxl57 dot ims dot intel dot com>
On 10/08/14 12:55, Ilya Enkovich wrote:
This patch introduces two IPA passes used by Pointer Bounds Checker. One pass creates clones for instrumentation. The other one transforms unneeded functions into thunks.
2014-10-08 Ilya Enkovich <email@example.com>
* ipa-chkp.c: New.
* ipa-chkp.h: New.
* Makefile.in (OBJS): Add ipa-chkp.o.
+ when linker reolution files are used. Linker has no info about
+ connection between original and instrumented function and
+ therefore we may wrongly decide (due to difference in assember
Sorry, I simply can't parse that sentence... Can you rewrite/revise it
to be clearer?
+ /* We want called_as_built_in recall instrumented calls
+ to instrumented built-in functions.
So you need to adjust the indices in those attributes so that they refer
to the right argument. I get that. My concern is how do we keep the
list of attributes that must be fixed up-to-date.
+ /* If function type has attribute with arg indexes then
+ we have to copy it fixing attribute ops. Map for
+ fixing is in indexes array. */
+ attrs = TYPE_ATTRIBUTES (type);
+ if (lookup_attribute ("nonnull", attrs)
+ || lookup_attribute ("format", attrs)
+ || lookup_attribute ("format_arg", attrs))
I can easily see someone adding a new argument attribute and folks
forgetting to update this code.
Seems to me we need to document the attribute code with a reference back
to these ipa-chkp bits. It's not foolproof, but it's better than
depending on my memory to catch this stuff during reviews.
OK with the nits above fixed and a suitable comment that folks adding
new attributes with parameter indices are likely to see to refer them
back to the index adjustment code in ipa-chkp.c.