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

--- Comment #12 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #11)
> I think there are cases where we set useful range even on other SSA_NAMEs
> than the single one used in the condition, and in some cases it should be
> good enough, even when the SSA_NAME from the condition has single use.

I thought those other SSA_NAMES were the ones I was testing, probably I didn't
look closely enough.

> Canonical example would be if (int_arg + 32U <= 64U) __builtin_unreachable
> (),

We don't quite seem to put a range on int_arg with this. We have one
temporarily, and deduce ranges for things computed based on int_arg, but I
don't see one on int_arg itself after the pass.

> etc.  So I wonder if we don't need to differentiate between that and the
> case like here, where we really don't derive anything useful from it
> something & const == const2, and if the other SSA_NAME(s) got useful range
> and any of them isn't single use, remove it too.

Yes, we should only remove __builtin_unreachable (which we currently don't do
at all) if we think we got enough information out of it, something like you
describe. And even then, there are various ways we may loose the range
information along the way.

Reply via email to