]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cgraph.h (tls_model_names): New variable.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jun 2014 02:46:34 +0000 (02:46 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jun 2014 02:46:34 +0000 (02:46 +0000)
* print-tree.c (print_node): Simplify.
* varpool.c (tls_model_names): New variable.
(dump_varpool_node): Output tls model.

* lto-symtab.c (lto_varpool_replace_node): Report TLS model conflicts.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211865 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cgraph.h
gcc/lto/ChangeLog
gcc/lto/lto-symtab.c
gcc/print-tree.c
gcc/varpool.c

index 3a52961fecb75de60088622149c8e1f712b6768d..1691cc0022e4a9e76b78b551886fed78fa8ad631 100644 (file)
@@ -1,3 +1,10 @@
+2014-06-20  Jan Hubicka  <hubicka@ucw.cz>
+
+       * cgraph.h (tls_model_names): New variable.
+       * print-tree.c (print_node): Simplify.
+       * varpool.c (tls_model_names): New variable.
+       (dump_varpool_node): Output tls model.
+
 2014-06-20  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-visibility.c (function_and_variable_visibility): Disable
index 8f8deae56c62a68c091941a8f55cd39a665549e2..2fad1931c1867cc9afddf71f7f47dc375fc8229f 100644 (file)
@@ -244,6 +244,7 @@ struct lto_file_decl_data;
 
 extern const char * const cgraph_availability_names[];
 extern const char * const ld_plugin_symbol_resolution_names[];
+extern const char * const tls_model_names[];
 
 /* Information about thunk, used only for same body aliases.  */
 
index e9ff1beae69704d3e62720e4e0807180b2542572..4086b2134eb53624f134e1fb281e78d49a2b697f 100644 (file)
@@ -1,3 +1,7 @@
+2014-06-20  Jan Hubicka  <hubicka@ucw.cz>
+
+       * lto-symtab.c (lto_varpool_replace_node): Report TLS model conflicts.
+
 2014-06-20  Jan Hubicka  <hubicka@ucw.cz>
 
        * lto.c (compare_tree_sccs_1): Do not compare priorities.
index 571b2dd386d2382e7d0d0d0a42834913e1bb2fdf..c02f987aaeaef5be74fe972a48706dd42c4c76f3 100644 (file)
@@ -116,6 +116,15 @@ lto_varpool_replace_node (varpool_node *vnode,
   if (DECL_INITIAL (vnode->decl)
       && vnode->decl != prevailing_node->decl)
     DECL_INITIAL (vnode->decl) = error_mark_node;
+
+  if (vnode->tls_model != prevailing_node->tls_model)
+    {
+      error_at (DECL_SOURCE_LOCATION (vnode->decl),
+               "%qD is defined as %s", vnode->decl, tls_model_names [vnode->tls_model]);
+      inform (DECL_SOURCE_LOCATION (prevailing_node->decl),
+             "previously defined here as %s",
+             tls_model_names [prevailing_node->tls_model]);
+    }
   /* Finally remove the replaced node.  */
   varpool_remove_node (vnode);
 }
index e26b0633d5831dad3be35c148415441fdde73186..91d88c2835d2de480ecefad5446760a11246523b 100644 (file)
@@ -418,24 +418,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
        fputs (" common", file);
       if (code == VAR_DECL && DECL_THREAD_LOCAL_P (node))
        {
-         enum tls_model kind = DECL_TLS_MODEL (node);
-         switch (kind)
-           {
-             case TLS_MODEL_GLOBAL_DYNAMIC:
-               fputs (" tls-global-dynamic", file);
-               break;
-             case TLS_MODEL_LOCAL_DYNAMIC:
-               fputs (" tls-local-dynamic", file);
-               break;
-             case TLS_MODEL_INITIAL_EXEC:
-               fputs (" tls-initial-exec", file);
-               break;
-             case TLS_MODEL_LOCAL_EXEC:
-               fputs (" tls-local-exec", file);
-               break;
-             default:
-               gcc_unreachable ();
-           }
+         fputs (" ", file);
+         fputs (tls_model_names[DECL_TLS_MODEL (node)], file);
        }
 
       if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
index ff6712764f116696ae3904e7fc90c870fd9bedac..f6f836539e8173a285964429b0d168a898af9add 100644 (file)
@@ -36,6 +36,10 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "pointer-set.h"
 
+const char * const tls_model_names[]={"none", "tls-emulated", "tls-real",
+                                     "tls-global-dynamic", "tls-local-dynamic",
+                                     "tls-initial-exec", "tls-local-exec"};
+
 /* List of hooks triggered on varpool_node events.  */
 struct varpool_node_hook_list {
   varpool_node_hook hook;
@@ -213,6 +217,8 @@ dump_varpool_node (FILE *f, varpool_node *node)
     fprintf (f, " const-value-known");
   if (node->writeonly)
     fprintf (f, " write-only");
+  if (node->tls_model)
+    fprintf (f, " %s", tls_model_names [node->tls_model]);
   fprintf (f, "\n");
 }