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: [trans-mem] undefined reference to a static cloned function


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~


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