[Patch, toplevel/config] fix tls.m4 configure race condition (bootstrap/PR43170)

Paolo Bonzini bonzini@gnu.org
Tue Jun 8 19:04:00 GMT 2010


On 06/08/2010 08:50 PM, Jakub Jelinek wrote:
> But what if gcc -fwhole-program -fsmart-opt figures out that thread_func is
> only ever used as a thread function called by ptread_create and therefore
> argument passed to it can't reference&a and thus p != q can be optimized as
> 1?

Or in Jack's code,

   __thread int a;
   int *pa;
   ...
   int main()
   {
      pa = &a;
      ...
   }

it doesn't even take such a smart optimizer:

1) With -fwhole-program pa is effectively static.

2) it also does not escape, so its definition can be propagated to use 
points.

... hence effectively you are back without the change you made.  Iain, 
can you please add volatile as suggested by Jakub (i.e. int *volatile)?

Thanks!

Paolo



More information about the Gcc-patches mailing list