This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7827: incorrect warning "will never be executed" when optimizing


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]