Bug 24475 - gcc.dg/tls/pr24428.c execution test and gcc.dg/tls/pr24428-2.c execution test fail on IA32
Summary: gcc.dg/tls/pr24428.c execution test and gcc.dg/tls/pr24428-2.c execution test...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Uroš Bizjak
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch
Depends on:
Blocks: 24476
  Show dependency treegraph
 
Reported: 2005-10-21 19:44 UTC by Joseph S. Myers
Modified: 2005-12-02 06:59 UTC (History)
2 users (show)

See Also:
Host:
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-15 13:43:11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph S. Myers 2005-10-21 19:44:10 UTC
FAIL: gcc.dg/tls/pr24428-2.c execution test
FAIL: gcc.dg/tls/pr24428.c execution test

have appeared on i686-pc-linux-gnu when those tests were added (20051018-20051020), on both mainline and 4.0 branch.

I also see such failures on IA64, for which I'll open a separate bug report.
Comment 1 Jakub Jelinek 2005-11-09 16:31:02 UTC
Works just fine here.  What glibc are you using?
pr24428.c and pr24428-2.c are the only dg-do run tls tests, so perhaps
your libc doesn't support TLS at all?
Comment 2 jsm-csl@polyomino.org.uk 2005-11-09 18:09:38 UTC
Subject: Re:  gcc.dg/tls/pr24428.c execution test and
 gcc.dg/tls/pr24428-2.c execution test fail on IA32

On Wed, 9 Nov 2005, jakub at gcc dot gnu dot org wrote:

> Works just fine here.  What glibc are you using?
> pr24428.c and pr24428-2.c are the only dg-do run tls tests, so perhaps
> your libc doesn't support TLS at all?

The tests changed from failing to working on my (CodeSourcery Automatic 
Testing System) nightly builds when I switched them from running on an 
i686-pc-linux-gnu system to running on an x86_64 system (with more recent 
libc), bootstrapping with an i686-pc-linux-gnu cross-compiler and 
configuring with --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu 
--target=i686-pc-linux-gnu; that is, the same compiler version failed 
under the pure 32-bit environment but passed when building as 32-bit under 
a 64-bit kernel (with more recent libc), and this was the only change in 
test results between the two environments apart from 
gcc.misc-tests/linkage.c which tries to link with programs built with 
"cc".  Both environments have some form of glibc 2.3.2; it's quite 
possible the older one doesn't support TLS.

If the state of "libc doesn't support TLS" can reliably be detected then 
perhaps the test should be marked UNSUPPORTED in that case.

Comment 3 Jakub Jelinek 2005-11-10 09:49:40 UTC
glibc can be configured without tls support when using --without-tls configure
switch.  I think glibc 2.3.2 defaulted to --without-tls, so you had to
explicitly request --with-tls support.

Does even a trivial __thread using program break fail at runtime?
__thread int thr;
int main (void) { return thr; }

Maybe either tls.exp or testsuite/lib/*.exp could check for this.
If the former, it would need moving runtime tls tests to say
testsuite/gcc.dg/tls/run/ and using a separate *.exp file for them,
if the latter set some dg-require-tls-libc or something like that.

Do you think there are enough people with prehistoric libcs building
new GCC to bother with it though?
Comment 4 jsm-csl@polyomino.org.uk 2005-11-12 14:24:01 UTC
Subject: Re:  gcc.dg/tls/pr24428.c execution test and
 gcc.dg/tls/pr24428-2.c execution test fail on IA32

On Thu, 10 Nov 2005, jakub at gcc dot gnu dot org wrote:

> Does even a trivial __thread using program break fail at runtime?
> __thread int thr;
> int main (void) { return thr; }

Yes, it segfaults on the system in question; it also seems to segfault 
with more recent glibc configured with --without-tls.

Comment 5 Richard Henderson 2005-11-15 01:57:48 UTC
(In reply to comment #3)
> Do you think there are enough people with prehistoric libcs building
> new GCC to bother with it though?

If someone wanted to do the work in the .exp files, I wouldn't be opposed.
But I also wouldn't mind just closing this as Someone Else's Problem.
Comment 6 Uroš Bizjak 2005-11-15 08:13:21 UTC
Perhaps a runtime check should be added to target-supports.exp
( check_effective_target_tls-runtime perhaps) that would check if the system is capable of running tls enabled binaries. Alternatively, my proposed patch (http://gcc.gnu.org/ml/gcc-patches/2005-11/msg00963.html) could try to run the tls testcase, instead of just compiling it.

However, addind { dg-require-effective-target tls-runtime }, runtime tests will also be skipped on the system that is otherwise able to compile testcases.

The job of compiler is IMO to compile sources correctly, and the purpose of runtime test is to check if the system is able to run testcases. Runtime failure, reported here, just says that the tested system is not able to run the testcase and that the system should be upgraded/fixed.
Comment 7 jsm-csl@polyomino.org.uk 2005-11-15 09:23:22 UTC
Subject: Re:  gcc.dg/tls/pr24428.c execution test and
 gcc.dg/tls/pr24428-2.c execution test fail on IA32

On Tue, 15 Nov 2005, uros at kss-loka dot si wrote:

> The job of compiler is IMO to compile sources correctly, and the purpose of
> runtime test is to check if the system is able to run testcases. Runtime

No, it is to check if the compiler generated correct code for the 
testcases.  If this fact cannot be tested because of system limitations 
the result should be UNSUPPORTED, whereas if it can be tested and the code 
was incorrect it should be FAIL.

Comment 8 uros 2005-12-01 06:52:15 UTC
Subject: Bug 24475

Author: uros
Date: Thu Dec  1 06:52:11 2005
New Revision: 107804

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107804
Log:
	PR target/24475
	* lib/target-supports.exp (check_effective_target_tls): New.
	(check_effective_target_tls_runtime): New.
	* gcc.dg/tls/tls.exp, g++.dg/tls/tls.exp: Remove check
	for TLS support.
	* gcc.dg/tls/opt-1.c, gcc.dg/tls/opt-2.c, gcc.dg/tls/opt-3.c,
	gcc.dg/tls/opt-4.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
	gcc.dg/tls/opt-7.c, gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c,
	gcc.dg/tls/opt-10.c, gcc.dg/tls/diag-1.c, gcc.dg/tls/diag-2.c,
	gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c,
	gcc.dg/tls/alias-1.c, gcc.dg/tls/alpha-1.c, gcc.dg/tls/asm-1.c,
	gcc.dg/tls/debug-1.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
	gcc.dg/tls/pic-1.c, gcc.dg/tls/section-1.c, gcc.dg/tls/struct-1.c,
	gcc.dg/tls/trivial.c, g++.dg/tls/diag-1.C, g++.dg/tls/diag-2.C,
	g++.dg/tls/diag-3.C, g++.dg/tls/diag-4.C, g++.dg/tls/init-1.C,
	g++.dg/tls/init-2.C, g++.dg/tls/trivial.C: Require
	effective-target TLS.
	* gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c, 
	g++.dg/tls/static-1a.cc, g++.dg/tls/static-1.C: Require
	effective-target TLS runtime.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/tls/diag-1.C
    trunk/gcc/testsuite/g++.dg/tls/diag-2.C
    trunk/gcc/testsuite/g++.dg/tls/diag-3.C
    trunk/gcc/testsuite/g++.dg/tls/diag-4.C
    trunk/gcc/testsuite/g++.dg/tls/init-1.C
    trunk/gcc/testsuite/g++.dg/tls/init-2.C
    trunk/gcc/testsuite/g++.dg/tls/static-1.C
    trunk/gcc/testsuite/g++.dg/tls/static-1a.cc
    trunk/gcc/testsuite/g++.dg/tls/tls.exp
    trunk/gcc/testsuite/g++.dg/tls/trivial.C
    trunk/gcc/testsuite/gcc.dg/tls/alias-1.c
    trunk/gcc/testsuite/gcc.dg/tls/alpha-1.c
    trunk/gcc/testsuite/gcc.dg/tls/asm-1.c
    trunk/gcc/testsuite/gcc.dg/tls/debug-1.c
    trunk/gcc/testsuite/gcc.dg/tls/diag-1.c
    trunk/gcc/testsuite/gcc.dg/tls/diag-2.c
    trunk/gcc/testsuite/gcc.dg/tls/diag-3.c
    trunk/gcc/testsuite/gcc.dg/tls/diag-4.c
    trunk/gcc/testsuite/gcc.dg/tls/diag-5.c
    trunk/gcc/testsuite/gcc.dg/tls/init-1.c
    trunk/gcc/testsuite/gcc.dg/tls/nonpic-1.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-1.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-10.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-11.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-2.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-3.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-4.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-5.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-6.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-7.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-8.c
    trunk/gcc/testsuite/gcc.dg/tls/opt-9.c
    trunk/gcc/testsuite/gcc.dg/tls/pic-1.c
    trunk/gcc/testsuite/gcc.dg/tls/pr24428-2.c
    trunk/gcc/testsuite/gcc.dg/tls/pr24428.c
    trunk/gcc/testsuite/gcc.dg/tls/section-1.c
    trunk/gcc/testsuite/gcc.dg/tls/struct-1.c
    trunk/gcc/testsuite/gcc.dg/tls/tls.exp
    trunk/gcc/testsuite/gcc.dg/tls/trivial.c
    trunk/gcc/testsuite/lib/target-supports.exp

Comment 9 uros 2005-12-02 06:43:50 UTC
Subject: Bug 24475

Author: uros
Date: Fri Dec  2 06:43:45 2005
New Revision: 107876

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107876
Log:
	PR target/24475
	* lib/target-supports.exp (check_effective_target_tls): New.
	(check_effective_target_tls_runtime): New.
	* gcc.dg/tls/tls.exp, g++.dg/tls/tls.exp: Remove check
	for TLS support.
	* gcc.dg/tls/opt-1.c, gcc.dg/tls/opt-2.c, gcc.dg/tls/opt-3.c,
	gcc.dg/tls/opt-4.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
	gcc.dg/tls/opt-7.c, gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c,
	gcc.dg/tls/opt-10.c, gcc.dg/tls/diag-1.c, gcc.dg/tls/diag-2.c,
	gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c,
	gcc.dg/tls/alias-1.c, gcc.dg/tls/alpha-1.c, gcc.dg/tls/asm-1.c,
	gcc.dg/tls/debug-1.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
	gcc.dg/tls/pic-1.c, gcc.dg/tls/section-1.c, gcc.dg/tls/struct-1.c,
	gcc.dg/tls/trivial.c, g++.dg/tls/diag-1.C, g++.dg/tls/diag-2.C,
	g++.dg/tls/diag-3.C, g++.dg/tls/diag-4.C, g++.dg/tls/init-1.C,
	g++.dg/tls/init-2.C, g++.dg/tls/trivial.C: Require
	effective-target TLS.
	* gcc.dg/tls/pr24428-2.c, gcc.dg/tls/pr24428.c, gcc.dg/tls/opt-11.c, 
	g++.dg/tls/static-1a.cc, g++.dg/tls/static-1.C: Require
	effective-target TLS runtime.


Modified:
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/diag-1.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/diag-2.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/diag-3.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/diag-4.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/init-1.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/init-2.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/static-1.C
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/static-1a.cc
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/tls.exp
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tls/trivial.C
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/alias-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/alpha-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/asm-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/debug-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/diag-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/diag-2.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/diag-3.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/diag-4.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/diag-5.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/init-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/nonpic-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-10.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-11.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-2.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-3.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-4.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-5.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-6.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-7.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-8.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/opt-9.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/pic-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/pr24428-2.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/pr24428.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/section-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/struct-1.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/tls.exp
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tls/trivial.c
    branches/gcc-4_1-branch/gcc/testsuite/lib/target-supports.exp

Comment 10 Uroš Bizjak 2005-12-02 06:59:51 UTC
Fixed on 4.1 and mainline.