In attachment, you find the code that is used inside the configure m4 macro for
detecting the presence of TLS.
This check is unreliable.
When compiled with -O2 (as done in configure) the result might be that the
compiler reports same adress due to optimization and decides there is no TLS.
When compiled with -O0, it yields the correct result.
This is an optimization artefact. Please extend the test with the two lines I
put in comment. This way the test succeeds correctly, even after optimization.
--
Summary: TLS detection in ./configure is wrong.
Product: gcc
Version: 4.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgomp
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jos dot de_laender at telenet dot be
GCC host triplet: i686-pc-mingw32
GCC target triplet: mingw64 - see description.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42829