re PR c++/6395 (gcc-3_1-branch regression for g++.old-deja/g++.jason/synth5.C)
authorJason Merrill <jason@redhat.com>
Tue, 23 Apr 2002 23:51:30 +0000 (19:51 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 23 Apr 2002 23:51:30 +0000 (19:51 -0400)
        PR c++/6395
        * decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i
        stuff for comdats.

From-SVN: r52696

gcc/cp/ChangeLog
gcc/cp/decl.c

index 027456165786b29492f3830e65a9b76ccf3f05ed..971d0bd63f51858a256931d54efd7a2f46f3ff50 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-24  Jason Merrill  <jason@redhat.com>
+
+       PR c++/6395
+       * decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i
+       stuff for comdats.
+
 2002-04-23  Jakub Jelinek  <jakub@redhat.com>
 
        * parse.y (check_class_key): Allow KEY to be union/enum/struct/class
index 58d93bc143cf2fcac0df8f80b07544aad5fa0c40..fe3b4a57f4c2b4a216ee41ef7059ee72f5b907c6 100644 (file)
@@ -7951,17 +7951,15 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
      DECL_STMT is expanded.  */
   defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl);
 
-  /* We try to defer namespace-scope static constants and template
-     instantiations so that they are not emitted into the object file
-     unnecessarily.  */
-  if ((!DECL_VIRTUAL_P (decl)
-       && TREE_READONLY (decl)
-       && DECL_INITIAL (decl) != NULL_TREE
-       && DECL_INITIAL (decl) != error_mark_node
-       && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
-       && toplev
-       && !TREE_PUBLIC (decl))
-      || DECL_COMDAT (decl))
+  /* We try to defer namespace-scope static constants so that they are
+     not emitted into the object file unnecessarily.  */
+  if (!DECL_VIRTUAL_P (decl)
+      && TREE_READONLY (decl)
+      && DECL_INITIAL (decl) != NULL_TREE
+      && DECL_INITIAL (decl) != error_mark_node
+      && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
+      && toplev
+      && !TREE_PUBLIC (decl))
     {
       /* Fool with the linkage of static consts according to #pragma
         interface.  */
@@ -7973,6 +7971,9 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
 
       defer_p = 1;
     }
+  /* Likewise for template instantiations.  */
+  else if (DECL_COMDAT (decl))
+    defer_p = 1;
 
   /* If we're deferring the variable, we only need to make RTL if
      there's an ASMSPEC.  Otherwise, we'll lazily create it later when