This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trans-mem] undefined reference to a static cloned function
- From: Richard Henderson <rth at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: Patrick Marlier <patrick dot marlier at unine dot ch>, FELBER Pascal <pascal dot felber at unine dot ch>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 15 Jun 2010 09:17:05 -0700
- Subject: Re: [trans-mem] undefined reference to a static cloned function
- References: <4BF3C398.9090407@unine.ch> <4BF4F6FC.1040204@unine.ch> <20100607134205.GA17619@redhat.com> <4C0D0507.1070200@unine.ch> <20100607174417.GA13762@redhat.com> <4C0F727F.4010709@unine.ch> <20100610133753.GA13188@redhat.com> <4C15D9D6.1080809@unine.ch> <20100615144126.GF27062@redhat.com>
On 06/15/2010 07:41 AM, Aldy Hernandez wrote:
>> As we can see here, calculateCircumCircle function can be called into a
>> transaction_safe function but also in a regular function. So the
>> function calculateCircumCircle must have the transaction_safe attribute
>> but...
>>
>> if calculateCircumCircle is declared and defined like that (without
>> transaction_safe):
>> static void
>> calculateCircumCircle (element_t* elementPtr)
>>
>> GCC doesn't complain about transaction_safe attribute. The reason could
>
> GCC doesn't complain because it can determine that calculateCircumCircle
> never enters serial irrevocable mode (besides I believe in this case the
> compiler inlines the call to calculateCircumCircle).
>
> This exclusion is done in ipa_tm_diagnose_tm_safe():
>
> if (!is_tm_callable (e->callee->decl)
> && e->callee->local.tm_may_enter_irr)
> error_at (gimple_location (e->call_stmt),
>
> I suppose we could warn regardless. I don't know if having the compiler
> outsmart us was part of rth's plan. Richard?
The intent of the spec is that static functions need not be explicitly
annotated, since the compiler *can* derive all the information it needs,
including implicitly generating a clone.
I've sort of lost the thread here... does that even answer the question?
r~