re PR target/45870 (note: non-delegitimized UNSPEC 5 found (-O1 -g))
authorJakub Jelinek <jakub@redhat.com>
Fri, 19 Nov 2010 07:22:22 +0000 (08:22 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 19 Nov 2010 07:22:22 +0000 (08:22 +0100)
PR target/45870
* dwarf2out.c (const_ok_for_output_1): Don't complain about
non-delegitimized TLS UNSPECs.

From-SVN: r166932

gcc/ChangeLog
gcc/dwarf2out.c

index 2016390b60e5476ee5bedfcfdee098d2a6209b63..66ca88442eec018140ff78abd69774480eb0a4fb 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/45870
+       * dwarf2out.c (const_ok_for_output_1): Don't complain about
+       non-delegitimized TLS UNSPECs.
+
 2010-11-18  Jack Howarth  <howarth@bromo.med.uc.edu>
            Ian Lance Taylor  <iant@google.com>
 
index ea3852e172f4017f922eb9c0a39448a277f59f10..3285dacdc6f1e501bceb9f5917d88a161081bbcf 100644 (file)
@@ -13503,11 +13503,18 @@ const_ok_for_output_1 (rtx *rtlp, void *data ATTRIBUTE_UNUSED)
       /* If delegitimize_address couldn't do anything with the UNSPEC, assume
         we can't express it in the debug info.  */
 #ifdef ENABLE_CHECKING
-      inform (current_function_decl
-             ? DECL_SOURCE_LOCATION (current_function_decl)
-             : UNKNOWN_LOCATION,
-             "non-delegitimized UNSPEC %d found in variable location",
-             XINT (rtl, 1));
+      /* Don't complain about TLS UNSPECs, those are just too hard to
+        delegitimize.  */
+      if (XVECLEN (rtl, 0) != 1
+         || GET_CODE (XVECEXP (rtl, 0, 0)) != SYMBOL_REF
+         || SYMBOL_REF_DECL (XVECEXP (rtl, 0, 0)) == NULL
+         || TREE_CODE (SYMBOL_REF_DECL (XVECEXP (rtl, 0, 0))) != VAR_DECL
+         || !DECL_THREAD_LOCAL_P (SYMBOL_REF_DECL (XVECEXP (rtl, 0, 0))))
+       inform (current_function_decl
+               ? DECL_SOURCE_LOCATION (current_function_decl)
+               : UNKNOWN_LOCATION,
+               "non-delegitimized UNSPEC %d found in variable location",
+               XINT (rtl, 1));
 #endif
       expansion_failed (NULL_TREE, rtl,
                        "UNSPEC hasn't been delegitimized.\n");