public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/65472] -Wunreachable-code failure
  2015-03-19 15:54 [Bug middle-end/65472] New: -Wunreachable-code failure skvadrik at gmail dot com
@ 2015-03-19 15:54 ` mpolacek at gcc dot gnu.org
  2015-03-19 15:58 ` skvadrik at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-19 15:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
-Wunreachable-code does nothing and is ignored.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/65472] New: -Wunreachable-code failure
@ 2015-03-19 15:54 skvadrik at gmail dot com
  2015-03-19 15:54 ` [Bug middle-end/65472] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: skvadrik at gmail dot com @ 2015-03-19 15:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

            Bug ID: 65472
           Summary: -Wunreachable-code failure
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: skvadrik at gmail dot com

Created attachment 35065
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35065&action=edit
1.c

Given the following code:

extern void f ();
void g ()
{
    for (;;)
    {
        f ();
        continue;
        f ();
    }
}

$ gcc -Wunreachable-code -c 1.c
$ clang -Wunreachable-code -c 1.c
1.c:9:3: warning: code will never be executed [-Wunreachable-code]
                f ();
                ^
1 warning generated.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/65472] -Wunreachable-code failure
  2015-03-19 15:54 [Bug middle-end/65472] New: -Wunreachable-code failure skvadrik at gmail dot com
  2015-03-19 15:54 ` [Bug middle-end/65472] " mpolacek at gcc dot gnu.org
@ 2015-03-19 15:58 ` skvadrik at gmail dot com
  2015-03-19 16:11 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: skvadrik at gmail dot com @ 2015-03-19 15:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

--- Comment #2 from Ulya <skvadrik at gmail dot com> ---
$ gcc -W -Wall -Wextra -c 1.c

gives the same result: no warning


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/65472] -Wunreachable-code failure
  2015-03-19 15:54 [Bug middle-end/65472] New: -Wunreachable-code failure skvadrik at gmail dot com
  2015-03-19 15:54 ` [Bug middle-end/65472] " mpolacek at gcc dot gnu.org
  2015-03-19 15:58 ` skvadrik at gmail dot com
@ 2015-03-19 16:11 ` mpolacek at gcc dot gnu.org
  2015-03-19 16:11 ` skvadrik at gmail dot com
  2015-03-19 16:13 ` manu at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-19 16:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yes, the warning has been removed altogether.  -Wunreachable-code is retained
only for backwards compatibility.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/65472] -Wunreachable-code failure
  2015-03-19 15:54 [Bug middle-end/65472] New: -Wunreachable-code failure skvadrik at gmail dot com
                   ` (2 preceding siblings ...)
  2015-03-19 16:11 ` mpolacek at gcc dot gnu.org
@ 2015-03-19 16:11 ` skvadrik at gmail dot com
  2015-03-19 16:13 ` manu at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: skvadrik at gmail dot com @ 2015-03-19 16:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

Ulya <skvadrik at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #4 from Ulya <skvadrik at gmail dot com> ---
So GCC's intended behavior is not to warn about unreachable code?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug middle-end/65472] -Wunreachable-code failure
  2015-03-19 15:54 [Bug middle-end/65472] New: -Wunreachable-code failure skvadrik at gmail dot com
                   ` (3 preceding siblings ...)
  2015-03-19 16:11 ` skvadrik at gmail dot com
@ 2015-03-19 16:13 ` manu at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu.org @ 2015-03-19 16:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org
         Resolution|FIXED                       |DUPLICATE

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Ulya from comment #4)
> So GCC's intended behavior is not to warn about unreachable code?

No, but the previous implementation of Wunreachable-code was very broken and
nobody knew how to fix it, thus it was eventually removed. Since then (years
ago!), nobody has offered a new implementation, which perhaps shows that there
is actually little interest in this warning in practice. In the past, we got
more reports about Wunreachable-code bogus warnings than about missed ones.

Unfortunately, there are very few GCC developers working on the C/C++ FEs right
now and they are very busy with other more urgent things, like structural work
and updating to new standards. In addition, implementing this properly in the
FE would need some kind of control-flow graph, which GCC only has in the
middle-end.

BTW, I don't think it is useful to close these reports as INVALID, since they
are in essence requests for a new implementation of -Wunreachable-code. On the
other hand, it is not useful to have a PR for each possible testcase, since as
far as we know, there is no one even planning to work on this, unfortunately.

*** This bug has been marked as a duplicate of bug 46476 ***
>From gcc-bugs-return-480841-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 19 15:54:02 2015
Return-Path: <gcc-bugs-return-480841-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 123370 invoked by alias); 19 Mar 2015 15:54:01 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 123107 invoked by uid 48); 19 Mar 2015 15:53:54 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/46476] Missing Warning about unreachable code after return
Date: Thu, 19 Mar 2015 16:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.6.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-46476-4-4uyVgIgKV8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-46476-4@http.gcc.gnu.org/bugzilla/>
References: <bug-46476-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01985.txt.bz2
Content-length: 482

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46476

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |skvadrik at gmail dot com

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
*** Bug 65472 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-480842-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 19 15:58:43 2015
Return-Path: <gcc-bugs-return-480842-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1161 invoked by alias); 19 Mar 2015 15:58:43 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 1089 invoked by uid 48); 19 Mar 2015 15:58:36 -0000
From: "skvadrik at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/65472] -Wunreachable-code failure
Date: Thu, 19 Mar 2015 16:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: skvadrik at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: resolution
Message-ID: <bug-65472-4-QG7U3y5XD2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65472-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65472-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01986.txt.bz2
Content-length: 451

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65472

Ulya <skvadrik at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|DUPLICATE                   |FIXED

--- Comment #6 from Ulya <skvadrik at gmail dot com> ---
(In reply to Manuel López-Ibáñez from comment #5)

I see. Thank you for a detailed answer. :)
>From gcc-bugs-return-480843-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 19 16:03:24 2015
Return-Path: <gcc-bugs-return-480843-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8554 invoked by alias); 19 Mar 2015 16:03:24 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8437 invoked by uid 48); 19 Mar 2015 16:03:15 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/65465] [5 Regression] Internal compiler error: in build2_stIat
Date: Thu, 19 Mar 2015 16:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ipa
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65465-4-LxUmuuTEKX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65465-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65465-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01987.txt.bz2
Content-length: 375

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide465

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:

struct A {};
struct B { virtual A foo () const; };
struct C { A foo () const; };
struct D : virtual B { A foo () const {} };
struct F : D { virtual int bar () const; };
int F::bar () const { return 0; }
A C::foo () const { return A (); }


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-19 15:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19 15:54 [Bug middle-end/65472] New: -Wunreachable-code failure skvadrik at gmail dot com
2015-03-19 15:54 ` [Bug middle-end/65472] " mpolacek at gcc dot gnu.org
2015-03-19 15:58 ` skvadrik at gmail dot com
2015-03-19 16:11 ` mpolacek at gcc dot gnu.org
2015-03-19 16:11 ` skvadrik at gmail dot com
2015-03-19 16:13 ` manu 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).