This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]