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: [PATCH] Fix PR49718 : allow no_instrument_function attribute in class member definition/declaration


On 01/09/14 07:17, Laurent Alfonsi wrote:
On 01/09/14 06:02, Jeff Law wrote:
On 01/08/14 02:05, Laurent Alfonsi wrote:
      All,

I was looking at PR49718. I have enclosed a simple fix for this bug
report.

2014-01-07  Laurent Alfonsi <laurent.alfonsi@st.com>

      * c-family/c-common.c
(handle_no_instrument_function_attribute): Allow
        no_instrument_function attribute in class member
definition/declaration.


Looking at the implementation of the function attributes, I see no
reason anymore to keep this error message.
Let me know if I missed something.
I have also added a testcase in the enclosed patch.

2014-01-07  Laurent Alfonsi <laurent.alfonsi@st.com>

      PR c++/49718
      * g++.dg/pr49718.C: New
Isn't the idea here that if we've already generated the function body
(presumably with instrumentation) that a no-instrument attribute
appearing on a later declaration won't do anything useful?

jeff


Jeff,

You are right. That's probably the reason.
 From what i can see, the code instrumentation is performed in the
gimplification pass (gimplify_function_tree), and the function attribute
is handled and attached earlier in the parsing phase.

I ve checked with an example like :
---8<------8<------8<------8<------8<---
int foo () {
   return 2;
}

int bar () {
   return 1;
}

int foo () __attribute__((no_instrument_function));
---8<------8<------8<------8<------8<---
The attribute is well honored on foo function.
I might need to add this test case too.
Thanks. I checked with Jakub and he confirmed that all the flags to disable unit-at-a-time mode are gone and there's no way to generate gimple for a function prior to parsing the entire TU.

That means this patch should be OK. I don't see you in the MAINTAINERS file or with an account on gcc.gnu.org, so I'll check it in for you shortly.

Thanks for your patience,

Jeff


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