This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR middle-end/43125 C/C++ front-end patch to merge DECL_PRESERVE_P
- From: Mike Stump <mikestump at comcast dot net>
- To: gcc-patches Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 19 Feb 2010 22:14:32 -0800
- Subject: PR middle-end/43125 C/C++ front-end patch to merge DECL_PRESERVE_P
This fixes a recent regression; the middle end now requires that
DECL_PRESERVE_P be merged with the change for PR43061.
Ok?
$ cat ~/diffs/merge.diffs
2010-02-19 Mike Stump <mikestump@comcast.net>
PR middle-end/43125
* decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2010-02-19 Mike Stump <mikestump@comcast.net>
PR middle-end/43125
* c-decl.c (merge_decls): Merge DECL_PRESERVE_P.
Doing diffs in .:
--- ./c-decl.c.~1~ 2010-01-27 07:39:43.000000000 -0800
+++ ./c-decl.c 2010-02-19 21:18:38.000000000 -0800
@@ -2387,6 +2387,10 @@ merge_decls (tree newdecl, tree olddecl,
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
--- ./cp/decl.c.~1~ 2010-02-09 02:17:00.000000000 -0800
+++ ./cp/decl.c 2010-02-19 21:19:21.000000000 -0800
@@ -2093,7 +2093,10 @@ duplicate_decls (tree newdecl, tree oldd
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;
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
--------------