public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "f.heckenbach@fh-soft.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103724] [9/10/11/12 Regression] invalid warning: iteration 7 invokes undefined behavior
Date: Wed, 09 Mar 2022 15:22:45 +0000	[thread overview]
Message-ID: <bug-103724-4-OKU1Y5HaVG@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103724-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Frank Heckenbach <f.heckenbach@fh-soft.de> ---
(In reply to Richard Biener from comment #6)
> (In reply to Frank Heckenbach from comment #5)
> > (In reply to Richard Biener from comment #4)
> > > One thing we could do is annotate struct loop * with the (high level)
> > > optimizations we've applied so that when we emit this warning we could say
> > > 
> > > note: this loop is the copy generated by loop unswitching where b == 0
> > > 
> > > or so.  Or maybe at least show
> > > 
> > > note: this loop was unswitched
> > 
> > If this is meant to apply to user-visible warnings, I'm not sure I'd like
> > it. I usually run with -Werror, and this would still be a warning turned
> > error then, wouldn't it?
> 
> Yes.  It might provide you with hints how to work around things though,
> like do if (c) since b must be != 0.

That was just a simplified test case. In my real code, there's nothing to
simplify from a user's point of view.

> That said, I don't think we can reasonably do something on the GCC side here.

How about an option or warning level (if not default) to just omit the warning
in the cases you'd say "note: this loop was unswitched"?

  parent reply	other threads:[~2022-03-09 15:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  3:05 [Bug c/103724] New: warning f.heckenbach@fh-soft.de
2021-12-15  3:11 ` [Bug c/103724] invalid warning: iteration 7 invokes undefined behavior f.heckenbach@fh-soft.de
2021-12-18  9:08 ` [Bug tree-optimization/103724] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2021-12-28 19:53 ` jakub at gcc dot gnu.org
2022-01-18 14:07 ` rguenth at gcc dot gnu.org
2022-01-20  3:34 ` f.heckenbach@fh-soft.de
2022-03-09 13:36 ` rguenth at gcc dot gnu.org
2022-03-09 15:22 ` f.heckenbach@fh-soft.de [this message]
2022-05-27  9:46 ` [Bug tree-optimization/103724] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:47 ` jakub at gcc dot gnu.org
2022-12-20 13:31 ` rguenth at gcc dot gnu.org
2023-07-07 10:41 ` [Bug tree-optimization/103724] [11/12/13/14 " 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-103724-4-OKU1Y5HaVG@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).