[Bug target/46972] __thread storage class variable gets optimized out on ARM
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
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
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
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 c/46972] New: __thread storage class variable gets optimized out on ARM
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46972 Summary: __thread storage class variable gets optimized out on ARM Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: paulius.zalec...@gmail.com Created attachment 22775 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22775 test case source code My host system is x86_64 and I am cross compiling this file(attached) for ARM with following command: arm-unknown-linux-uclibcgnueabi-gcc -pipe -O1 -Wall thread_test.c -o thread_test Executing ./thread_test on my ARM system results in segfault. If I comment out test_set() function or remove __thread specifier or compile it without optimizations (-O0) test passes. I tried this test also on my host system (Fedora 14) and it does not fail there. My cross compiler is vanila GCC + patches from: http://git.buildroot.net/buildroot/tree/toolchain/gcc/4.5.1 It took me about a week to realize what is going on and make this test case out of not working cross compiled pulseaudio-0.9.22 server :)
[Bug target/46972] __thread storage class variable gets optimized out on ARM
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