]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/6381 (Missing assembler label)
authorJason Merrill <jason@redhat.com>
Thu, 16 May 2002 05:02:35 +0000 (01:02 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 16 May 2002 05:02:35 +0000 (01:02 -0400)
        PR c++/6381
        * dwarf2out.c (rtl_for_decl_location): Only expand INTEGER_CST and
        REAL_CST.

From-SVN: r53507

gcc/ChangeLog
gcc/dwarf2out.c

index eba8d047b3904a91d17184f7324eefba00e8739b..02ca41c684d8f8a5bc92bd55b6eacd8d2c15246a 100644 (file)
@@ -1,6 +1,8 @@
-2002-05-14  Release Manager
+2002-05-08  Jason Merrill  <jason@redhat.com>
 
-       * GCC 3.1 Released.
+       PR c++/6381
+       * dwarf2out.c (rtl_for_decl_location): Only expand INTEGER_CST and
+       REAL_CST.
 
 2002-05-14  Release Manager
 
index afd9737e035b1b131c5c9589781b7c5fc2c5a677..01c88af88d7ede063f88a22598771e92b5670460 100644 (file)
@@ -8941,21 +8941,18 @@ rtl_for_decl_location (decl)
                  == strlen (TREE_STRING_POINTER (init)) + 1))
            rtl = gen_rtx_CONST_STRING (VOIDmode, TREE_STRING_POINTER (init));
        }
-
-#if 0
-      /* We mustn't actually emit anything here, as we might not get a
-         chance to emit any symbols we refer to.  For the release, don't
-         try to get this right.  */
-      if (rtl == NULL)
+      /* If the initializer is something that we know will expand into an
+        immediate RTL constant, expand it now.  Expanding anything else
+        tends to produce unresolved symbols; see debug/5770 and c++/6381.  */
+      else if (TREE_CODE (DECL_INITIAL (decl)) == INTEGER_CST
+              || TREE_CODE (DECL_INITIAL (decl)) == REAL_CST)
        {
          rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode,
                             EXPAND_INITIALIZER);
-         /* If expand_expr returned a MEM, we cannot use it, since
-            it won't be output, leading to unresolved symbol.  */
+         /* If expand_expr returns a MEM, it wasn't immediate.  */
          if (rtl && GET_CODE (rtl) == MEM)
-           rtl = NULL;
+           abort ();
        }
-#endif
     }
 
 #ifdef ASM_SIMPLIFY_DWARF_ADDR