public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36367] New: warning for questionable compound expression
@ 2008-05-29 11:50 ebotcazou at gcc dot gnu dot org
2008-05-29 12:01 ` [Bug c/36367] " rguenth at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-05-29 11:50 UTC (permalink / raw)
To: gcc-bugs
This typo in check_for_nested_with_variably_modified was present for 4 years
and hampered the inliner without anyone noticing:
Index: tree-nested.c
===================================================================
--- tree-nested.c (revision 136121)
+++ tree-nested.c (working copy)
@@ -693,7 +693,7 @@ check_for_nested_with_variably_modified
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
{
for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg))
- if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl)
+ if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
return true;
It would be nice for the compiler to warn in this case, i.e. when members of
a compound expression (except for the last) don't have obvious side-effects.
--
Summary: warning for questionable compound expression
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ebotcazou at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/36367] warning for questionable compound expression
2008-05-29 11:50 [Bug c/36367] New: warning for questionable compound expression ebotcazou at gcc dot gnu dot org
@ 2008-05-29 12:01 ` rguenth at gcc dot gnu dot org
2010-03-31 9:58 ` pzhao at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-29 12:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-05-29 12:00 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2008-05-29 12:00:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/36367] warning for questionable compound expression
2008-05-29 11:50 [Bug c/36367] New: warning for questionable compound expression ebotcazou at gcc dot gnu dot org
2008-05-29 12:01 ` [Bug c/36367] " rguenth at gcc dot gnu dot org
@ 2010-03-31 9:58 ` pzhao at gcc dot gnu dot org
2010-03-31 10:09 ` ebotcazou at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: pzhao at gcc dot gnu dot org @ 2010-03-31 9:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pzhao at gcc dot gnu dot org 2010-03-31 09:58 -------
Author: ebotcazou
Date: Thu May 29 11:33:17 2008
New Revision: 136154
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136154
Log:
* tree-nested.c (check_for_nested_with_variably_modified): Fix typo.
Added:
trunk/gcc/testsuite/gcc.dg/nested-func-6.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-nested.c
--
pzhao at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/36367] warning for questionable compound expression
2008-05-29 11:50 [Bug c/36367] New: warning for questionable compound expression ebotcazou at gcc dot gnu dot org
2008-05-29 12:01 ` [Bug c/36367] " rguenth at gcc dot gnu dot org
2010-03-31 9:58 ` pzhao at gcc dot gnu dot org
@ 2010-03-31 10:09 ` ebotcazou at gcc dot gnu dot org
2010-04-01 9:19 ` pzhao at gcc dot gnu dot org
2010-04-01 10:10 ` ebotcazou at gcc dot gnu dot org
4 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-03-31 10:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ebotcazou at gcc dot gnu dot org 2010-03-31 10:08 -------
Not clear what happened but the aforementioned commit is not a fix for this PR.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pzhao at gcc dot gnu dot org
Status|RESOLVED |REOPENED
Resolution|FIXED |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/36367] warning for questionable compound expression
2008-05-29 11:50 [Bug c/36367] New: warning for questionable compound expression ebotcazou at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-03-31 10:09 ` ebotcazou at gcc dot gnu dot org
@ 2010-04-01 9:19 ` pzhao at gcc dot gnu dot org
2010-04-01 10:10 ` ebotcazou at gcc dot gnu dot org
4 siblings, 0 replies; 7+ messages in thread
From: pzhao at gcc dot gnu dot org @ 2010-04-01 9:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pzhao at gcc dot gnu dot org 2010-04-01 09:19 -------
Sorry! I have misunderstood this issue before.
Is it to ask for warn at the following test case?
=====================
int foo (int a)
{
return a;
}
int bar (int c)
{
if (foo (1), c) // Warn foo(1) don't have obvious side-effects here?
return 1;
else
return 0;
}
===================
--
pzhao at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2008-05-29 12:00:46 |2010-04-01 09:19:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/36367] warning for questionable compound expression
2008-05-29 11:50 [Bug c/36367] New: warning for questionable compound expression ebotcazou at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-04-01 9:19 ` pzhao at gcc dot gnu dot org
@ 2010-04-01 10:10 ` ebotcazou at gcc dot gnu dot org
4 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2010-04-01 10:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from ebotcazou at gcc dot gnu dot org 2010-04-01 10:10 -------
> Is it to ask for warn at the following test case?
Yes, it is. An additional condition could be that the type be non-void.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/36367] warning for questionable compound expression
[not found] <bug-36367-4@http.gcc.gnu.org/bugzilla/>
@ 2012-11-19 10:11 ` ebotcazou at gcc dot gnu.org
0 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2012-11-19 10:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36367
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEW
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-11-19 10:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-29 11:50 [Bug c/36367] New: warning for questionable compound expression ebotcazou at gcc dot gnu dot org
2008-05-29 12:01 ` [Bug c/36367] " rguenth at gcc dot gnu dot org
2010-03-31 9:58 ` pzhao at gcc dot gnu dot org
2010-03-31 10:09 ` ebotcazou at gcc dot gnu dot org
2010-04-01 9:19 ` pzhao at gcc dot gnu dot org
2010-04-01 10:10 ` ebotcazou at gcc dot gnu dot org
[not found] <bug-36367-4@http.gcc.gnu.org/bugzilla/>
2012-11-19 10:11 ` ebotcazou at gcc dot gnu.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).