This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
- From: "iains at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Apr 2010 19:24:19 -0000
- Subject: [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
- References: <bug-43708-19002@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from iains at gcc dot gnu dot org 2010-04-09 19:24 -------
(In reply to comment #1)
> Guess setting DECL_READ_P at the same spot as TREE_USED in config/darwin-c.c
> could fix this.
Yes, it does thanks the head up.
... is TREE_USED() redundant in this case?
(I've left it in place at the moment)
tested on i686-apple-darwin9 (but only off a stage3-bubble).
Index: gcc/config/darwin-c.c
===================================================================
--- gcc/config/darwin-c.c (revision 158165)
+++ gcc/config/darwin-c.c (working copy)
@@ -144,7 +144,10 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_
tree local = lookup_name (decl);
if (local && (TREE_CODE (local) == PARM_DECL
|| TREE_CODE (local) == VAR_DECL))
- TREE_USED (local) = 1;
+ {
+ TREE_USED (local) = 1;
+ DECL_READ_P (local) = 1;
+ }
tok = pragma_lex (&x);
if (tok != CPP_COMMA)
break;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708