public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43553]  New: libgcc built with -DHAVE_CC_TLS against xgcc when emutls in use
@ 2010-03-28  2:03 howarth at nitro dot med dot uc dot edu
  2010-03-28  2:07 ` [Bug c/43553] " howarth at nitro dot med dot uc dot edu
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: howarth at nitro dot med dot uc dot edu @ 2010-03-28  2:03 UTC (permalink / raw)
  To: gcc-bugs

While testing the proposed patch to eliminate race conditions in indirect value
profiling...

http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00892.html

I found that the many profile testcases failed due unresolved symbols such
as...
__emutls_v.__gcov_indirect_call_counters and
___emutls_v.__gcov_indirect_call_callee".
A review of the later stage libgcc builds revealed that the -DHAVE_CC_TLS flag
was passed
without the associated -DUSE_EMUTLS. The current test for setting -DHAVE_CC_TLS
is based
on the test program...

__thread int a; int b; int main() { return a = b; }

which while it fails under the Apple system gcc 4.2.1 compiler with the
error...

thread_test.c:1: error: thread-local storage not supported for this target

compiles without error and runs fine under the newly built xgcc compiler (due
to
the emutls support). The easy fix appears to be...

2010-03-27  Jack Howarth <howarth@bromo.med.uc.edu>

        * config.host (tmake_file): Add t-emutls for *-*-darwin*.
        * t-emutls: New file.

Index: libgcc/config.host
===================================================================
--- libgcc/config.host  (revision 157779)
+++ libgcc/config.host  (working copy)
@@ -597,6 +597,12 @@
 esac

 case ${host} in
+*-*-darwin*)
+       tmake_file="${tmake_file} t-emutls"
+       ;;
+esac
+
+case ${host} in
 i[34567]86-*-darwin* | x86_64-*-darwin* | \
   i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
   i[34567]86-*-linux* | x86_64-*-linux* | \
Index: libgcc/config/t-emutls 
===================================================================
--- libgcc/config/t-emutls      (revision 0)
+++ libgcc/config/t-emutls      (revision 0)
@@ -0,0 +1,2 @@
+# Use emulated thread-local storage
+INTERNAL_CFLAGS += -DUSE_EMUTLS

which bootstraps fine on both x86_64-apple-darwin9 and x86_64-apple-darwin10
with the proposed race condition patch...

Index: gcc/tree-profile.c
===================================================================
--- gcc/tree-profile.c  (revision 157765)
+++ gcc/tree-profile.c  (working copy)
@@ -82,6 +82,7 @@
   TREE_PUBLIC (ic_void_ptr_var) = 0;
   DECL_ARTIFICIAL (ic_void_ptr_var) = 1;
   DECL_INITIAL (ic_void_ptr_var) = NULL;
+  DECL_TLS_MODEL (ic_void_ptr_var) = decl_default_tls_model (ic_void_ptr_var);
   varpool_finalize_decl (ic_void_ptr_var);

   gcov_type_ptr = build_pointer_type (get_gcov_type ());
@@ -93,6 +94,7 @@
   TREE_PUBLIC (ic_gcov_type_ptr_var) = 0;
   DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1;
   DECL_INITIAL (ic_gcov_type_ptr_var) = NULL;
+  DECL_TLS_MODEL (ic_gcov_type_ptr_var) = decl_default_tls_model
(ic_gcov_type_ptr_var);
   varpool_finalize_decl (ic_gcov_type_ptr_var);
 }

with no regressions in the testsuite (particularly the profile section). I
assume when the race
condition fix is committed other targets that use emutls will need to be added
to the 
case statement.


-- 
           Summary: libgcc built with -DHAVE_CC_TLS against xgcc when emutls
                    in use
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: howarth at nitro dot med dot uc dot edu
 GCC build triplet: *-apple-darwin*
  GCC host triplet: *-apple-darwin*
GCC target triplet: *-apple-darwin*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43553


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2010-08-20 11:39 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-28  2:03 [Bug c/43553] New: libgcc built with -DHAVE_CC_TLS against xgcc when emutls in use howarth at nitro dot med dot uc dot edu
2010-03-28  2:07 ` [Bug c/43553] " howarth at nitro dot med dot uc dot edu
2010-03-28  2:17 ` howarth at nitro dot med dot uc dot edu
2010-03-28  4:39 ` howarth at nitro dot med dot uc dot edu
2010-03-28  5:49 ` howarth at nitro dot med dot uc dot edu
2010-03-28 16:11 ` howarth at nitro dot med dot uc dot edu
2010-03-28 16:29 ` howarth at nitro dot med dot uc dot edu
2010-03-28 19:21 ` howarth at nitro dot med dot uc dot edu
2010-03-28 20:31 ` howarth at nitro dot med dot uc dot edu
2010-03-28 20:59 ` howarth at nitro dot med dot uc dot edu
2010-03-30 13:09 ` rguenth at gcc dot gnu dot org
2010-03-30 16:01 ` rguenth at gcc dot gnu dot org
2010-03-31  2:17 ` howarth at nitro dot med dot uc dot edu
2010-03-31  2:44 ` howarth at nitro dot med dot uc dot edu
2010-03-31  3:54 ` howarth at nitro dot med dot uc dot edu
2010-03-31  6:15 ` howarth at nitro dot med dot uc dot edu
2010-04-01  8:02 ` developer at sandoe-acoustics dot co dot uk
2010-04-01  8:09 ` bonzini at gnu dot org
2010-04-01  8:30 ` developer at sandoe-acoustics dot co dot uk
2010-04-02 21:16 ` developer at sandoe-acoustics dot co dot uk
2010-04-02 21:32 ` developer at sandoe-acoustics dot co dot uk
2010-04-03 11:01 ` developer at sandoe-acoustics dot co dot uk
2010-04-03 20:03 ` dominiq at lps dot ens dot fr
2010-04-04  7:18 ` bonzini at gnu dot org
2010-04-04 16:30 ` howarth at nitro dot med dot uc dot edu
2010-04-04 16:33 ` howarth at nitro dot med dot uc dot edu
2010-04-04 17:59 ` howarth at nitro dot med dot uc dot edu
2010-04-04 20:19 ` developer at sandoe-acoustics dot co dot uk
2010-04-04 21:09 ` howarth at nitro dot med dot uc dot edu
2010-04-05  8:33 ` developer at sandoe-acoustics dot co dot uk
2010-05-25 12:51 ` iains at gcc dot gnu dot org
2010-05-27 15:10 ` mrs at gcc dot gnu dot org
2010-05-28  0:02 ` howarth at nitro dot med dot uc dot edu
2010-08-20 11:39 ` howarth at nitro dot med dot uc dot edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).