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

--- Comment #7 from Frank Heckenbach <f.heckenb...@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"?

Reply via email to