public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1
@ 2005-11-16 18:21 arjanv at redhat dot com
2005-11-16 18:21 ` [Bug c/24900] " arjanv at redhat dot com
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: arjanv at redhat dot com @ 2005-11-16 18:21 UTC (permalink / raw)
To: gcc-bugs
attached testcase gives a "value computed is not used" warning.
Testcase comes from the linux kernel which spews this for every .c file
compiled
--
Summary: new "value computed is not used" warning in gcc 4.1
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: arjanv at redhat dot com
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/24900] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
@ 2005-11-16 18:21 ` arjanv at redhat dot com
2005-11-16 18:23 ` arjanv at redhat dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: arjanv at redhat dot com @ 2005-11-16 18:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from arjanv at redhat dot com 2005-11-16 18:21 -------
Created an attachment (id=10257)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10257&action=view)
fairly minimal testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/24900] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
2005-11-16 18:21 ` [Bug c/24900] " arjanv at redhat dot com
@ 2005-11-16 18:23 ` arjanv at redhat dot com
2005-11-16 18:30 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: arjanv at redhat dot com @ 2005-11-16 18:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from arjanv at redhat dot com 2005-11-16 18:23 -------
(compiler flags used were -O2 -Wall)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/24900] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
2005-11-16 18:21 ` [Bug c/24900] " arjanv at redhat dot com
2005-11-16 18:23 ` arjanv at redhat dot com
@ 2005-11-16 18:30 ` pinskia at gcc dot gnu dot org
2005-11-16 18:33 ` [Bug c/24900] [4.1 Regression] " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-16 18:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2005-11-16 18:30 -------
Here is a further reduced testcase:
unsigned long t(void);
void apic_write_atomic(unsigned long reg, unsigned int v)
{
((__typeof__(*((volatile unsigned int *)((t())+reg))))t());
}
-Wall is all is needed to reproduce the issue.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (2 preceding siblings ...)
2005-11-16 18:30 ` pinskia at gcc dot gnu dot org
@ 2005-11-16 18:33 ` pinskia at gcc dot gnu dot org
2005-11-16 18:36 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-16 18:33 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.1.0
Known to work| |4.0.3
Summary|new "value computed is not |[4.1 Regression] new "value
|used" warning in gcc 4.1 |computed is not used"
| |warning in gcc 4.1
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (3 preceding siblings ...)
2005-11-16 18:33 ` [Bug c/24900] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-11-16 18:36 ` pinskia at gcc dot gnu dot org
2005-11-16 18:46 ` [Bug middle-end/24900] " pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-16 18:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-11-16 18:36 -------
Reduces down to:
int f(void);
void g(void)
{
(unsigned) f();
}
The typeof gets changed over to unsigned.
Maybe this is not a bug after all. Can someone else comment on this?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (4 preceding siblings ...)
2005-11-16 18:36 ` pinskia at gcc dot gnu dot org
@ 2005-11-16 18:46 ` pinskia at gcc dot gnu dot org
2005-11-16 20:11 ` aldyh at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-11-16 18:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2005-11-16 18:45 -------
Confirmed, this comes from a macro expansion, we really should not warn about
this.
The bug is in stmt.c.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c |middle-end
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-11-16 18:45:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (5 preceding siblings ...)
2005-11-16 18:46 ` [Bug middle-end/24900] " pinskia at gcc dot gnu dot org
@ 2005-11-16 20:11 ` aldyh at gcc dot gnu dot org
2005-11-17 21:12 ` aldyh at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: aldyh at gcc dot gnu dot org @ 2005-11-16 20:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from aldyh at gcc dot gnu dot org 2005-11-16 20:10 -------
I'll take a look at this.
--
aldyh at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |aldyh at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (6 preceding siblings ...)
2005-11-16 20:11 ` aldyh at gcc dot gnu dot org
@ 2005-11-17 21:12 ` aldyh at gcc dot gnu dot org
2005-11-17 21:15 ` aldyh at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: aldyh at gcc dot gnu dot org @ 2005-11-17 21:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from aldyh at gcc dot gnu dot org 2005-11-17 21:12 -------
We used to allow this, but have now made the warning stricter. This behavior
was done deliberately. See:
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00275.html
As is explained in the thread, you can modify the macro to use statement
expressions and avoid the warning.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (7 preceding siblings ...)
2005-11-17 21:12 ` aldyh at gcc dot gnu dot org
@ 2005-11-17 21:15 ` aldyh at gcc dot gnu dot org
2006-01-16 15:30 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: aldyh at gcc dot gnu dot org @ 2005-11-17 21:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from aldyh at gcc dot gnu dot org 2005-11-17 21:15 -------
See previous comment.
--
aldyh at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (8 preceding siblings ...)
2005-11-17 21:15 ` aldyh at gcc dot gnu dot org
@ 2006-01-16 15:30 ` pinskia at gcc dot gnu dot org
2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
2006-01-26 3:02 ` mike at codeweavers dot com
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-16 15:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2006-01-16 15:30 -------
*** Bug 25810 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wingo at pobox dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (9 preceding siblings ...)
2006-01-16 15:30 ` pinskia at gcc dot gnu dot org
@ 2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
2006-01-26 3:02 ` mike at codeweavers dot com
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-25 13:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2006-01-25 13:06 -------
*** Bug 25955 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mike at codeweavers dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/24900] [4.1 Regression] new "value computed is not used" warning in gcc 4.1
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
` (10 preceding siblings ...)
2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
@ 2006-01-26 3:02 ` mike at codeweavers dot com
11 siblings, 0 replies; 13+ messages in thread
From: mike at codeweavers dot com @ 2006-01-26 3:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from mike at codeweavers dot com 2006-01-26 03:02 -------
Unfortunately statement expressions don't look like portable C.
The (windowsx.h) macros we use in Wine are Windows macros and can't be changed.
To get rid of these warnings it's likely we'll have to turn off the computed
value not used warning, which used to show some useful warnings...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24900
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-01-26 3:02 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-16 18:21 [Bug c/24900] New: new "value computed is not used" warning in gcc 4.1 arjanv at redhat dot com
2005-11-16 18:21 ` [Bug c/24900] " arjanv at redhat dot com
2005-11-16 18:23 ` arjanv at redhat dot com
2005-11-16 18:30 ` pinskia at gcc dot gnu dot org
2005-11-16 18:33 ` [Bug c/24900] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-11-16 18:36 ` pinskia at gcc dot gnu dot org
2005-11-16 18:46 ` [Bug middle-end/24900] " pinskia at gcc dot gnu dot org
2005-11-16 20:11 ` aldyh at gcc dot gnu dot org
2005-11-17 21:12 ` aldyh at gcc dot gnu dot org
2005-11-17 21:15 ` aldyh at gcc dot gnu dot org
2006-01-16 15:30 ` pinskia at gcc dot gnu dot org
2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
2006-01-26 3:02 ` mike at codeweavers dot com
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).