[Bug target/46972] __thread storage class variable gets optimized out on ARM

2011-12-14 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.6.0

--- Comment #10 from Andrew Pinski  2011-12-15 
01:53:39 UTC ---
Fixed in 4.6.0 from reading the comments.


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-21 Thread iains at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

Iain Sandoe  changed:

   What|Removed |Added

 CC||iains at gcc dot gnu.org

--- Comment #9 from Iain Sandoe  2010-12-21 13:12:53 
UTC ---
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > I think enumtls has been fixed on the trunk with respect of 
> > > fsection-anchors. 
> > > Can you try the trunk?
> > 
> > Yes, looks like this bug is fixed in trunk. Assembly output looks sane. I 
> > will
> > see if it works on real hardware some time later today. Do you know svn
> > revision it got fixed?
> 
> No but the change was done by Iain Sandoe to fix enum TLS with LTO on darwin.

The fix to emuTLS on trunk is from Richard Henderson's new implementation.

http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162549

I made some fixes to LTO-compatibility and Section anchors, but they primarily
affect ObjC* and PPC-darwin, so likely not relevant to your case.


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-20 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #8 from Andrew Pinski  2010-12-20 
16:51:29 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > I think enumtls has been fixed on the trunk with respect of 
> > fsection-anchors. 
> > Can you try the trunk?
> 
> Yes, looks like this bug is fixed in trunk. Assembly output looks sane. I will
> see if it works on real hardware some time later today. Do you know svn
> revision it got fixed?

No but the change was done by Iain Sandoe to fix enum TLS with LTO on darwin.


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-20 Thread paulius.zaleckas at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #7 from Paulius Zaleckas  
2010-12-20 11:28:14 UTC ---
(In reply to comment #6)
> I think enumtls has been fixed on the trunk with respect of fsection-anchors. 
> Can you try the trunk?

Yes, looks like this bug is fixed in trunk. Assembly output looks sane. I will
see if it works on real hardware some time later today. Do you know svn
revision it got fixed?


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-19 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #6 from Andrew Pinski  2010-12-19 
21:53:14 UTC ---
I think enumtls has been fixed on the trunk with respect of fsection-anchors. 
Can you try the trunk?


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-19 Thread paulius.zaleckas at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #5 from Paulius Zaleckas  
2010-12-19 19:39:07 UTC ---
Did some testing through various GCC versions:

4.5.2 - buggy
4.4.5 - buggy
4.3.5 - OK, but does not have -fsection-anchors optimization for ARM


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-19 Thread paulius.zaleckas at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #4 from Paulius Zaleckas  
2010-12-19 16:07:15 UTC ---
Created attachment 22823
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22823
diff with and without -fsection-anchors

I have found out that it is -fsection-anchors optimization causing this bug.
Attached -S assembler output diff with and without this option.


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-16 Thread paulius.zaleckas at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #3 from Paulius Zaleckas  
2010-12-16 20:11:54 UTC ---
(In reply to comment #2)
> So I suspect the issue is dependent on emutls or uclibc.

Yes, you are right. I have experimented today with few toolchains and build few
variants myself and I have discovered that gcc has to be built with
--disable-tls configure option to reproduce this bug.


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-16 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

Mikael Pettersson  changed:

   What|Removed |Added

 CC||mikpe at it dot uu.se

--- Comment #2 from Mikael Pettersson  2010-12-16 
09:14:33 UTC ---
The test case works for me on armv5tel-linux-gnueabi with gcc 4.4, 4.5, and
4.6.
Comparing your assemby code with mine I see that your calls
__emutls_get_address while mine calls __aeabi_read_tp, and the section
allocation for .LANCHOR0 is different (your is in .bss, mine is in .section
.tdata,"awT",%progbits).

So I suspect the issue is dependent on emutls or uclibc.


[Bug target/46972] __thread storage class variable gets optimized out on ARM

2010-12-15 Thread paulius.zaleckas at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972

--- Comment #1 from Paulius Zaleckas  
2010-12-15 21:14:16 UTC ---
Created attachment 22776
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22776
assembler

This is what I get with gcc's -S -fverbose-asm