This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20681] [4.0/4.1 Regression] wrong "control reaches" warning with switches
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2005 04:46:43 -0000
- Subject: [Bug c++/20681] [4.0/4.1 Regression] wrong "control reaches" warning with switches
- References: <bug-20681-9121@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from pinskia at gcc dot gnu dot org 2005-10-17 04:46 -------
Subject: Re: [4.0/4.1 Regression] wrong "control reaches" warning with
switches
On Oct 17, 2005, at 12:39 AM, ian at airs dot com wrote:
> Fixing this in the middle-end will require a version of
> remove_useless_stmts
> which is clever enough to efficiently discard statements which follow
> a return
> statement. Andrew was working on that at one point; I don't recall
> what the
> status is.
The status is that it will only be approved for 4.2 (this was decided
by RTH). The problem is also comes into play with extra unreachable
labels which was not going to be fixed by my patch and is what
really causes this bug, rather than the stuff after a goto/return.
We lower the eh before removing the unreachable label which causes
us to think that there is a way to get fallthrough the switch. This
means
that we need a switch table for cleanup of the variable (the call to
the dtor).
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20681