OSDN Git Service

* c-decl.c (duplicate_decls): Re-invoke make_decl_rtl if
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 May 2003 05:40:12 +0000 (05:40 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 May 2003 05:40:12 +0000 (05:40 +0000)
        the old decl had instantiated DECL_RTL.

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

gcc/ChangeLog
gcc/c-decl.c

index 16949fa..a384ca8 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-13  Richard Henderson  <rth@redhat.com>
+
+       * c-decl.c (duplicate_decls): Re-invoke make_decl_rtl if
+       the old decl had instantiated DECL_RTL.
+
 2003-05-13  Mike Stump  <mrs@apple.com>
 
        * doc/invoke.texi (Option Summary): Kill off documentation for -$.
index b27ca06..28ba643 100644 (file)
@@ -1529,6 +1529,15 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
      Update OLDDECL to be the same.  */
   DECL_ATTRIBUTES (olddecl) = DECL_ATTRIBUTES (newdecl);
 
+  /* If OLDDECL had its DECL_RTL instantiated, re-invoke make_decl_rtl
+     so that encode_section_info has a chance to look at the new decl
+     flags and attributes.  */
+  if (DECL_RTL_SET_P (olddecl)
+      && (TREE_CODE (olddecl) == FUNCTION_DECL
+         || (TREE_CODE (olddecl) == VAR_DECL
+             && TREE_STATIC (olddecl))))
+    make_decl_rtl (olddecl, NULL);
+
   return 1;
 }