From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6044 invoked by alias); 4 Sep 2002 16:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6017 invoked by uid 71); 4 Sep 2002 16:46:01 -0000 Resent-Date: 4 Sep 2002 16:46:01 -0000 Resent-Message-ID: <20020904164601.6016.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, duchier@ps.uni-sb.de Received: (qmail 3613 invoked by uid 61); 4 Sep 2002 16:43:03 -0000 Message-Id: <20020904164303.3612.qmail@sources.redhat.com> Date: Wed, 04 Sep 2002 09:46:00 -0000 From: duchier@ps.uni-sb.de Reply-To: duchier@ps.uni-sb.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7827: incorrect warning "will never be executed" when optimizing X-SW-Source: 2002-09/txt/msg00059.txt.bz2 List-Id: >Number: 7827 >Category: c++ >Synopsis: incorrect warning "will never be executed" when optimizing >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Sep 04 09:46:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: duchier@ps.uni-sb.de >Release: 3.2.1 20020904 (prerelease) >Organization: >Environment: System: Linux speedy 2.4.18-5 #1 Mon Jun 10 15:31:48 EDT 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc-3_2-branch/configure --enable-languages=c,c++ --prefix=/home/denys/src/GNU/GCC/install-3_2 >Description: compiler issues incorrect warning about unreachable code (when -O is supplied). I don't know if it actually incorrectly deletes code that it thinks is unreachable. >How-To-Repeat: Executing: c++ -O -Wunreachable-code -c foo.cc Prints: foo.cc: In function `bool foo(Node*)': foo.cc:11: warning: will never be executed >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/x-c++src; name="foo.cc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="foo.cc" Y2xhc3MgTm9kZSB7CnByaXZhdGU6CiAgYm9vbCBmbGFnOwpwdWJsaWM6CiAgTm9kZShib29sIGYp OmZsYWcoZil7fQogIGJvb2wgaXNFbXB0eSgpIHsgcmV0dXJuIGZsYWc7fQp9OwoKYm9vbCBmb28o Tm9kZSpwMSkgewogIHdoaWxlIChwMSkKICAgIGlmIChwMS0+aXNFbXB0eSgpKQogICAgICByZXR1 cm4gdHJ1ZTsKICByZXR1cm4gZmFsc2U7Cn0K