public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25973] New: Wrong warning: control reaches end of non-void function
@ 2006-01-26 13:47 ssomers at opnet dot com
2006-01-26 13:57 ` [Bug c++/25973] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
` (12 more replies)
0 siblings, 13 replies; 14+ messages in thread
From: ssomers at opnet dot com @ 2006-01-26 13:47 UTC (permalink / raw)
To: gcc-bugs
-Wall produces warning on second function, not on slightly simpler first
function.
struct C {
C() { }
~C() {}
};
int fine(int p) {
C c;
if (p) {
if (p == 4) {
return 1;
} else {
return 2;
}
} else {
return 3;
}
}
int foul(int p) {
C c;
int pcopy = p;
if (pcopy && p) {
if (p == 4) {
return 1;
} else {
return 2;
}
} else {
return 3;
}
}
Probably a duplicate of 20624 or so. I can't access newer version right now.
Occurs in 4.0.1, 4.0.0, not in 3.4.5
--
Summary: Wrong warning: control reaches end of non-void function
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ssomers at opnet dot com
GCC host triplet: sparc-sun-solaris2.8
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
@ 2006-01-26 13:57 ` pinskia at gcc dot gnu dot org
2006-01-26 13:58 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 13:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-01-26 13:57 -------
Confirmed, the problem is slightly different from PR 20624 (but it is related).
I might look at this more.
-----
We are adding an extra goto when gimplifing. I have not looked why yet.
if (p == 4)
{
D.1782 = 1;
return D.1782;
}
else
{
D.1782 = 2;
return D.1782;
}
goto <D1781>;
That goto is causing the whole issue.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC host triplet|sparc-sun-solaris2.8 |
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2006-01-26 13:57:49
date| |
Summary|Wrong warning: control |[4.0/4.1/4.2 Regression]
|reaches end of non-void |Wrong warning: control
|function |reaches end of non-void
| |function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
2006-01-26 13:57 ` [Bug c++/25973] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-26 13:58 ` pinskia at gcc dot gnu dot org
2006-01-27 14:52 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-26 13:58 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
2006-01-26 13:57 ` [Bug c++/25973] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-01-26 13:58 ` pinskia at gcc dot gnu dot org
@ 2006-01-27 14:52 ` pinskia at gcc dot gnu dot org
2006-02-01 3:00 ` mmitchel at gcc dot gnu dot org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-27 14:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-01-27 14:52 -------
The problem here is that the C++ front-end produces IF_STMT and not COND_EXPR.
I am going to mark this as a memory hog as it does cause excessive trees for
bigger testcases.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |memory-hog
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (2 preceding siblings ...)
2006-01-27 14:52 ` pinskia at gcc dot gnu dot org
@ 2006-02-01 3:00 ` mmitchel at gcc dot gnu dot org
2006-03-11 3:22 ` mmitchel at gcc dot gnu dot org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-02-01 3:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from mmitchel at gcc dot gnu dot org 2006-02-01 03:00 -------
This will never be release-critical; P5.
Comment #2 does not seem relevant; the C++ front end gimplifys IF_STMTs by
turning them into COND_EXPRs.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (3 preceding siblings ...)
2006-02-01 3:00 ` mmitchel at gcc dot gnu dot org
@ 2006-03-11 3:22 ` mmitchel at gcc dot gnu dot org
2006-05-30 9:43 ` joerg dot richter at pdv-fs dot de
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11 3:22 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.3 |4.0.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (4 preceding siblings ...)
2006-03-11 3:22 ` mmitchel at gcc dot gnu dot org
@ 2006-05-30 9:43 ` joerg dot richter at pdv-fs dot de
2007-02-03 16:14 ` [Bug c++/25973] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: joerg dot richter at pdv-fs dot de @ 2006-05-30 9:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from joerg dot richter at pdv-fs dot de 2006-05-30 09:43 -------
Before I file a new bug, here is another testcase:
struct Block
{
public:
Block();
~Block();
};
bool func( bool bar )
{
Block block;
bool foo = false;
if( !foo || bar )
do { return true; } while( 0 );
else
do { return false; } while( 0 );
}
--
joerg dot richter at pdv-fs dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |joerg dot richter at pdv-fs
| |dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2/4.3 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (5 preceding siblings ...)
2006-05-30 9:43 ` joerg dot richter at pdv-fs dot de
@ 2007-02-03 16:14 ` gdr at gcc dot gnu dot org
2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from gdr at gcc dot gnu dot org 2007-02-03 16:14 -------
Won't fix in GCC-4.0.x. Adjustine milestone.
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.4 |---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2/4.3 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (6 preceding siblings ...)
2007-02-03 16:14 ` [Bug c++/25973] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
@ 2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
2007-02-14 9:37 ` mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2007-02-03 17:27 UTC (permalink / raw)
To: gcc-bugs
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.0/4.1/4.2/4.3 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (7 preceding siblings ...)
2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
@ 2007-02-14 9:37 ` mmitchel at gcc dot gnu dot org
2008-07-04 20:18 ` [Bug c++/25973] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14 9:37 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.1.2 |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.2/4.3/4.4 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (8 preceding siblings ...)
2007-02-14 9:37 ` mmitchel at gcc dot gnu dot org
@ 2008-07-04 20:18 ` jsm28 at gcc dot gnu dot org
2009-03-31 19:09 ` [Bug c++/25973] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 20:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jsm28 at gcc dot gnu dot org 2008-07-04 20:18 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2/4.3/4.4 Regression]|[4.2/4.3/4.4 Regression]
|Wrong warning: control |Wrong warning: control
|reaches end of non-void |reaches end of non-void
|function |function
Target Milestone|4.1.3 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.3/4.4/4.5 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (9 preceding siblings ...)
2008-07-04 20:18 ` [Bug c++/25973] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2009-03-31 19:09 ` jsm28 at gcc dot gnu dot org
2009-08-04 12:34 ` rguenth at gcc dot gnu dot org
2010-05-22 18:16 ` [Bug c++/25973] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 19:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jsm28 at gcc dot gnu dot org 2009-03-31 19:08 -------
Closing 4.2 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.2/4.3/4.4/4.5 Regression]|[4.3/4.4/4.5 Regression]
|Wrong warning: control |Wrong warning: control
|reaches end of non-void |reaches end of non-void
|function |function
Target Milestone|4.2.5 |4.3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.3/4.4/4.5 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (10 preceding siblings ...)
2009-03-31 19:09 ` [Bug c++/25973] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
@ 2009-08-04 12:34 ` rguenth at gcc dot gnu dot org
2010-05-22 18:16 ` [Bug c++/25973] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from rguenth at gcc dot gnu dot org 2009-08-04 12:27 -------
GCC 4.3.4 is being released, adjusting target milestone.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.4 |4.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/25973] [4.3/4.4/4.5/4.6 Regression] Wrong warning: control reaches end of non-void function
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
` (11 preceding siblings ...)
2009-08-04 12:34 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:16 ` rguenth at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2010-05-22 18:10 -------
GCC 4.3.5 is being released, adjusting target milestone.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.5 |4.3.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-05-22 18:16 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 13:47 [Bug c++/25973] New: Wrong warning: control reaches end of non-void function ssomers at opnet dot com
2006-01-26 13:57 ` [Bug c++/25973] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-01-26 13:58 ` pinskia at gcc dot gnu dot org
2006-01-27 14:52 ` pinskia at gcc dot gnu dot org
2006-02-01 3:00 ` mmitchel at gcc dot gnu dot org
2006-03-11 3:22 ` mmitchel at gcc dot gnu dot org
2006-05-30 9:43 ` joerg dot richter at pdv-fs dot de
2007-02-03 16:14 ` [Bug c++/25973] [4.0/4.1/4.2/4.3 " gdr at gcc dot gnu dot org
2007-02-03 17:27 ` jsm28 at gcc dot gnu dot org
2007-02-14 9:37 ` mmitchel at gcc dot gnu dot org
2008-07-04 20:18 ` [Bug c++/25973] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-03-31 19:09 ` [Bug c++/25973] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:34 ` rguenth at gcc dot gnu dot org
2010-05-22 18:16 ` [Bug c++/25973] [4.3/4.4/4.5/4.6 " rguenth 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).