re PR target/43708 (gcc.dg/pragma-darwin.c "set not used", not working with pragma)
authorIain Sandoe <iains@gcc.gnu.org>
Fri, 7 May 2010 17:34:31 +0000 (17:34 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Fri, 7 May 2010 17:34:31 +0000 (17:34 +0000)
PR target/43708
* config/darwin-c.c (darwin_pragma_unused): Set DECL_READ_P
in addition to TREE_USED, to avoid "set but unused" warnings.

From-SVN: r159164

gcc/ChangeLog
gcc/config/darwin-c.c

index 5467fa98d3755fd31a94069eeec2d247aa1d98ec..58a3276992b3822bc203f4657118736f5b694274 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-07  Iain Sandoe <iains@gcc.gnu.org>
+
+       PR target/43708
+       * config/darwin-c.c (darwin_pragma_unused): Set DECL_READ_P
+       in addition to TREE_USED, to avoid "set but unused" warnings.
+
 2010-05-07  Changpeng Fang  <changpeng.fang@amd.com>
 
        * tree-ssa-loop-prefetch.c (TRIP_COUNT_TO_AHEAD_RATIO): New.
index 862a1d1f4c08bd23860ae3638b2c924ba472a912..bd7c987e7446e4478df94702b3a0c73afe0916a7 100644 (file)
@@ -144,7 +144,10 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
          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;