public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
@ 2004-09-27 20:24 ` bangerth at dealii dot org
2004-09-27 20:33 ` [Bug middle-end/17703] " pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2004-09-27 20:24 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.0.0
Known to work| |3.4.1
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached
@ 2004-09-27 20:24 bangerth at dealii dot org
2004-09-27 20:24 ` [Bug c++/17703] " bangerth at dealii dot org
` (11 more replies)
0 siblings, 12 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2004-09-27 20:24 UTC (permalink / raw)
To: gcc-bugs
Since recently, I get a warning from this piece of code:
--------------------
int foo(int first) {
while (true) {
return first;
}
}
--------------------
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -Wall -c x.cc
x.cc: In function `int foo(int)':
x.cc:5: warning: control reaches end of non-void function
The message is clearly bogus, since the loop has a return
statement, but no edge to the end of the while loop. The message
breaks my nightly -Werror builds since the code is inside libstdc++
where I can't fix it (the original code was in std::__unguarded_partition).
This is a regression on mainline that I'd kindly like to ask to have fixed
soonish...
W.
--
Summary: [4.0 regression] spurious error about end of function
reached
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
2004-09-27 20:24 ` [Bug c++/17703] " bangerth at dealii dot org
@ 2004-09-27 20:33 ` pinskia at gcc dot gnu dot org
2004-09-27 20:42 ` bangerth at ices dot utexas dot edu
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-27 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-09-27 20:33 -------
Confirmed, I should note that cc1 does not have the problem, this is related to while (1) not being
gimplified to "if(1) else" instead we are making a temparary variable for the 1 and then progating it
back for optimizations. This can be considered both a compile-time-hog and memory-hog also.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|c++ |middle-end
Ever Confirmed| |1
Keywords| |compile-time-hog, memory-hog
Last reconfirmed|0000-00-00 00:00:00 |2004-09-27 20:33:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
2004-09-27 20:24 ` [Bug c++/17703] " bangerth at dealii dot org
2004-09-27 20:33 ` [Bug middle-end/17703] " pinskia at gcc dot gnu dot org
@ 2004-09-27 20:42 ` bangerth at ices dot utexas dot edu
2004-10-05 14:30 ` reichelt at gcc dot gnu dot org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bangerth at ices dot utexas dot edu @ 2004-09-27 20:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at ices dot utexas dot edu 2004-09-27 20:42 -------
Subject: Re: [4.0 regression] spurious error about end of function reached
> This can be considered both a compile-time-hog and memory-hog also.
This would probably give me the honor of having created the shortest testcase
in these classes :-)
Nevertheless, my request is not just to fix a nuisance in terms of compile
time or memory consumption, but a definitely wrong warning that makes it
impossible to compile with -Werrot...
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ices.utexas.edu
www: http://www.ices.utexas.edu/~bangerth/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (2 preceding siblings ...)
2004-09-27 20:42 ` bangerth at ices dot utexas dot edu
@ 2004-10-05 14:30 ` reichelt at gcc dot gnu dot org
2004-10-05 14:37 ` bangerth at dealii dot org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-05 14:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-05 14:30 -------
Seconded.
I just tripped over this, too.
Btw, we could add "rejects-valid" to the keywords as well
as it prevents compiles of valid code with "-Werror".
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Keywords| |monitored
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (3 preceding siblings ...)
2004-10-05 14:30 ` reichelt at gcc dot gnu dot org
@ 2004-10-05 14:37 ` bangerth at dealii dot org
2004-10-05 18:58 ` reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: bangerth at dealii dot org @ 2004-10-05 14:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-10-05 14:37 -------
Indeed. Let's just do that :-)
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Keywords| |rejects-valid
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (4 preceding siblings ...)
2004-10-05 14:37 ` bangerth at dealii dot org
@ 2004-10-05 18:58 ` reichelt at gcc dot gnu dot org
2004-10-06 5:07 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-05 18:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-10-05 18:58 -------
Here's an example using the STL:
=================================
#include <algorithm>
void foo()
{
int i;
std::sort(&i,&i+1);
}
=================================
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (5 preceding siblings ...)
2004-10-05 18:58 ` reichelt at gcc dot gnu dot org
@ 2004-10-06 5:07 ` pinskia at gcc dot gnu dot org
2004-10-06 13:26 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06 5:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-06 05:07 -------
I think the problem here is that we are no longer folding CLEANUP_POINT_EXPR < INTEGER_CST <1>>
into just INTEGER_CST <1>, there is another bug like this. I will be working on a patch to fix this soon.
RTH removed the foldding because it was causing too many problems as it removed
CLEANUP_POINT_EXPR too much. I will be hugely more conservative when removing
CLEANUP_POINT_EXPR and I create a function called build_fold_cleanup_point_expr. This should also
speed up the compiler in two ways, we never create the CLEANUP_POINT_EXPR in the first place and we
don't create as many temporaries as before.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (6 preceding siblings ...)
2004-10-06 5:07 ` pinskia at gcc dot gnu dot org
@ 2004-10-06 13:26 ` pinskia at gcc dot gnu dot org
2004-10-07 14:55 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06 13:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-06 13:25 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00491.html>.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (7 preceding siblings ...)
2004-10-06 13:26 ` pinskia at gcc dot gnu dot org
@ 2004-10-07 14:55 ` pinskia at gcc dot gnu dot org
2004-10-09 18:22 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-07 14:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-07 14:55 -------
Newest patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00633.html>.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (8 preceding siblings ...)
2004-10-07 14:55 ` pinskia at gcc dot gnu dot org
@ 2004-10-09 18:22 ` pinskia at gcc dot gnu dot org
2004-10-11 3:42 ` cvs-commit at gcc dot gnu dot org
2004-10-11 3:42 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-09 18:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-09 18:22 -------
Newest patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00832.html>.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (10 preceding siblings ...)
2004-10-11 3:42 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-11 3:42 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-11 3:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-11 03:42 -------
Subject: Bug 17703
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pinskia@gcc.gnu.org 2004-10-11 03:42:09
Modified files:
gcc : ChangeLog fold-const.c tree.h
gcc/cp : ChangeLog semantics.c typeck.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/init: for3.C
gcc/testsuite/g++.dg/opt: switch2.C
gcc/testsuite/g++.dg/warn: Wreturn-2.C
Log message:
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17554
part of c++/17657
middle-end/17703
* semantics.c (maybe_cleanup_point_expr): Call
fold_build_cleanup_point_expr.
(maybe_cleanup_point_expr_void): New function.
(add_decl_expr): Call maybe_cleanup_point_expr_void.
(finish_expr_stmt): Likewise.
(finish_return_stmt): Likewise.
(finish_for_expr): Likewise.
(finish_asm_stmt): Likewise.
* typeck.c (condition_conversion): Call
fold_build_cleanup_point_expr.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17703
part of PR c++/17657
* fold-const.c (fold_build_cleanup_point_expr): New function.
* tree.h (fold_build_cleanup_point_expr): Prototype.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17554
* g++.dg/init/for3.C: New test.
PR c++/17657
* g++.dg/opt/switch2.C: New test.
PR middle-end/17703
* g++.dg/warn/Wreturn-2.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5829&r2=2.5830
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.467&r2=1.468
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.636&r2=1.637
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4420&r2=1.4421
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.444&r2=1.445
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.581&r2=1.582
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4432&r2=1.4433
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/for3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/switch2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wreturn-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-11 03:42 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug middle-end/17703] [4.0 regression] spurious error about end of function reached
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
` (9 preceding siblings ...)
2004-10-09 18:22 ` pinskia at gcc dot gnu dot org
@ 2004-10-11 3:42 ` cvs-commit at gcc dot gnu dot org
2004-10-11 3:42 ` pinskia at gcc dot gnu dot org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-11 3:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-11 03:42 -------
Subject: Bug 17703
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: pinskia@gcc.gnu.org 2004-10-11 03:42:09
Modified files:
gcc : ChangeLog fold-const.c tree.h
gcc/cp : ChangeLog semantics.c typeck.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/init: for3.C
gcc/testsuite/g++.dg/opt: switch2.C
gcc/testsuite/g++.dg/warn: Wreturn-2.C
Log message:
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17554
part of c++/17657
middle-end/17703
* semantics.c (maybe_cleanup_point_expr): Call
fold_build_cleanup_point_expr.
(maybe_cleanup_point_expr_void): New function.
(add_decl_expr): Call maybe_cleanup_point_expr_void.
(finish_expr_stmt): Likewise.
(finish_return_stmt): Likewise.
(finish_for_expr): Likewise.
(finish_asm_stmt): Likewise.
* typeck.c (condition_conversion): Call
fold_build_cleanup_point_expr.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/17703
part of PR c++/17657
* fold-const.c (fold_build_cleanup_point_expr): New function.
* tree.h (fold_build_cleanup_point_expr): Prototype.
2004-10-10 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/17554
* g++.dg/init/for3.C: New test.
PR c++/17657
* g++.dg/opt/switch2.C: New test.
PR middle-end/17703
* g++.dg/warn/Wreturn-2.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5829&r2=2.5830
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.467&r2=1.468
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.636&r2=1.637
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4420&r2=1.4421
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.444&r2=1.445
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.581&r2=1.582
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4432&r2=1.4433
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/for3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/switch2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wreturn-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17703
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2004-10-11 3:42 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-27 20:24 [Bug c++/17703] New: [4.0 regression] spurious error about end of function reached bangerth at dealii dot org
2004-09-27 20:24 ` [Bug c++/17703] " bangerth at dealii dot org
2004-09-27 20:33 ` [Bug middle-end/17703] " pinskia at gcc dot gnu dot org
2004-09-27 20:42 ` bangerth at ices dot utexas dot edu
2004-10-05 14:30 ` reichelt at gcc dot gnu dot org
2004-10-05 14:37 ` bangerth at dealii dot org
2004-10-05 18:58 ` reichelt at gcc dot gnu dot org
2004-10-06 5:07 ` pinskia at gcc dot gnu dot org
2004-10-06 13:26 ` pinskia at gcc dot gnu dot org
2004-10-07 14:55 ` pinskia at gcc dot gnu dot org
2004-10-09 18:22 ` pinskia at gcc dot gnu dot org
2004-10-11 3:42 ` cvs-commit at gcc dot gnu dot org
2004-10-11 3:42 ` pinskia 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).