public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43708]  New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
@ 2010-04-09 17:08 iains at gcc dot gnu dot org
  2010-04-09 18:37 ` [Bug target/43708] " jakub at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-04-09 17:08 UTC (permalink / raw)
  To: gcc-bugs

FAIL: gcc.dg/pragma-darwin.c (test for excess errors)
Excess errors:
/GCC/gcc-live-trunk/gcc/testsuite/gcc.dg/pragma-darwin.c:44:7: warning:
variable 'x' set but not used
/GCC/gcc-live-trunk/gcc/testsuite/gcc.dg/pragma-darwin.c:65:10: warning:
variable 'b' set but not used
/GCC/gcc-live-trunk/gcc/testsuite/gcc.dg/pragma-darwin.c:65:7: warning:
variable 'a' set but not used

====
int
main ()
{
  int x, z;  /* { dg-warning "unused variable 'z'" } */
  #pragma unused (x, y)

=====
#pragma unused  /* { dg-warning "missing '.' after '#pragma unused" } */
#pragma unused (a  /* { dg-warning "missing '.' after '#pragma unused" } */
#pragma unused (b) foo /* { dg-warning "junk at end of '#pragma unused'" } */


-- 
           Summary: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used",
                    not working with pragma
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: iains at gcc dot gnu dot org
GCC target triplet: *-apple-darwin9


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
@ 2010-04-09 18:37 ` jakub at gcc dot gnu dot org
  2010-04-09 19:24 ` iains at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-09 18:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2010-04-09 18:37 -------
Guess setting DECL_READ_P at the same spot as TREE_USED in config/darwin-c.c
could fix this.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
  2010-04-09 18:37 ` [Bug target/43708] " jakub at gcc dot gnu dot org
@ 2010-04-09 19:24 ` iains at gcc dot gnu dot org
  2010-04-11 19:31 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-04-09 19:24 UTC (permalink / raw)
  To: gcc-bugs



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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
  2010-04-09 18:37 ` [Bug target/43708] " jakub at gcc dot gnu dot org
  2010-04-09 19:24 ` iains at gcc dot gnu dot org
@ 2010-04-11 19:31 ` rguenth at gcc dot gnu dot org
  2010-04-11 19:53 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-11 19:31 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-04-11 19:31 ` rguenth at gcc dot gnu dot org
@ 2010-04-11 19:53 ` jakub at gcc dot gnu dot org
  2010-04-14 15:08 ` iains at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-11 19:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2010-04-11 19:53 -------
TREE_USED is not redundant.  The patch looks good to me, though I can't approve
it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-04-11 19:53 ` jakub at gcc dot gnu dot org
@ 2010-04-14 15:08 ` iains at gcc dot gnu dot org
  2010-05-07 17:35 ` mrs at gcc dot gnu dot org
  2010-05-07 17:35 ` mrs at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-04-14 15:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from iains at gcc dot gnu dot org  2010-04-14 15:08 -------
see :
http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00535.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-05-07 17:35 ` mrs at gcc dot gnu dot org
@ 2010-05-07 17:35 ` mrs at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mrs at gcc dot gnu dot org @ 2010-05-07 17:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mrs at gcc dot gnu dot org  2010-05-07 17:34 -------
Subject: Bug 43708

Author: mrs
Date: Fri May  7 17:34:31 2010
New Revision: 159164

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159164
Log:
        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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/darwin-c.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/43708] [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma
  2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-04-14 15:08 ` iains at gcc dot gnu dot org
@ 2010-05-07 17:35 ` mrs at gcc dot gnu dot org
  2010-05-07 17:35 ` mrs at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mrs at gcc dot gnu dot org @ 2010-05-07 17:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mrs at gcc dot gnu dot org  2010-05-07 17:35 -------
Thanks.


-- 

mrs at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43708


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-05-07 17:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 17:08 [Bug c/43708] New: [4.6 Regression] gcc.dg/pragma-darwin.c "set not used", not working with pragma iains at gcc dot gnu dot org
2010-04-09 18:37 ` [Bug target/43708] " jakub at gcc dot gnu dot org
2010-04-09 19:24 ` iains at gcc dot gnu dot org
2010-04-11 19:31 ` rguenth at gcc dot gnu dot org
2010-04-11 19:53 ` jakub at gcc dot gnu dot org
2010-04-14 15:08 ` iains at gcc dot gnu dot org
2010-05-07 17:35 ` mrs at gcc dot gnu dot org
2010-05-07 17:35 ` mrs at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).