This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Dwarf TLS testcase


Hi!

I've fixed today a bug on the redhat/gcc-4_4-branch caused by
resolve_addr dwarf2out.c backports not handling INTERNAL_DW_OP_tls_addr
which has been removed on the trunk.  Here is a testcase for that
I've committed also to the trunk as obvious, more testcases never hurt.

2009-12-16  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/debug/tls-1.c: New test.

--- gcc/testsuite/gcc.dg/debug/tls-1.c.jj	2009-12-16 09:50:11.000000000 +0100
+++ gcc/testsuite/gcc.dg/debug/tls-1.c	2009-12-16 10:12:12.000000000 +0100
@@ -0,0 +1,19 @@
+/* Test that optimized out __thread var doesn't have its location
+   referenced in debug info.  */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+static __thread int vara;
+
+int
+foo (int b)
+{
+  return vara + b;
+}
+
+int
+main (void)
+{
+  return foo (0);
+}

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]