]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/43125 (Revision 156907 failed gcc.dg/attr-used.c)
authorMike Stump <mikestump@comcast.net>
Sat, 20 Feb 2010 17:28:14 +0000 (17:28 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Sat, 20 Feb 2010 17:28:14 +0000 (17:28 +0000)
PR middle-end/43125
* c-decl.c (merge_decls): Merge DECL_PRESERVE_P.

From-SVN: r156927

gcc/ChangeLog
gcc/c-decl.c

index 4ab4c0d6e87111d0726d4e97bc602e2c39bdae52..aa2d0fa4dbe4ee995f1227aed84654d8edfc9513 100644 (file)
@@ -37,6 +37,9 @@
 
 2010-02-19  Mike Stump  <mikestump@comcast.net>
 
+       PR middle-end/43125
+       * c-decl.c (merge_decls): Merge DECL_PRESERVE_P.
+
        PR objc/43061
        * cgraphunit.c (process_function_and_variable_attributes): Check
        DECL_PRESERVE_P instead of looking up attribute "used".
index e48cdc88e4e9a68e929bedff1acb9dbce428ccb5..e8e7a45f94f32cb37b91655399b250ebc7db6aeb 100644 (file)
@@ -2387,6 +2387,10 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
     TREE_USED (newdecl) = 1;
   else if (TREE_USED (newdecl))
     TREE_USED (olddecl) = 1;
+  if (DECL_PRESERVE_P (olddecl))
+    DECL_PRESERVE_P (newdecl) = 1;
+  else if (DECL_PRESERVE_P (newdecl))
+    DECL_PRESERVE_P (olddecl) = 1;
 
   /* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
      But preserve OLDDECL's DECL_UID, DECL_CONTEXT and