public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/61867] gcc can't detect obviously false test
Date: Tue, 22 Jul 2014 10:10:00 -0000	[thread overview]
Message-ID: <bug-61867-4-w39HxINlXM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61867-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to David Binderman from comment #3)
> I think that all that needs to happen is a warning is produced
> where either the detection or reduction takes place.

There is no single place, it's a result of constant propagation and a whole
range of optimisations cooperating. Those optimisations are a good thing, you
don't want to spit out a warning every time the compiler decides it can remove
part of the code, you'd end up with either hundreds of warnings for correct
code or disabling all optimisations.

> As ever, users are free to ignore warnings. egrep -v is
> useful, I find.

egrep is useless for ignoring warnings. It might help on the command line, but
not if you run the compiler from an editor or IDE, or with -Werror etc.

Just because you don't mind ignoring warnings doesn't mean it is appropriate
for GCC to start spitting out poor quality warnings.


  parent reply	other threads:[~2014-07-22 10:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-61867-4@http.gcc.gnu.org/bugzilla/>
2014-07-21 19:34 ` manu at gcc dot gnu.org
2014-07-21 19:51 ` dcb314 at hotmail dot com
2014-07-22 10:10 ` redi at gcc dot gnu.org [this message]
2014-07-23 12:44 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-61867-4-w39HxINlXM@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).