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: Aldy Hernandez <aldyh at redhat dot com>
- To: Patrick Marlier <patrick dot marlier at unine dot ch>
- Cc: Richard Henderson <rth at redhat dot com>, 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 10:41:27 -0400
- 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>
> 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?
Aldy