On Wed, Feb 23, 2022 at 11:38:30AM +0100, Richard Biener wrote:
> If we go for a match.pd solution I'd go with the other one but as said
> in the PR I think we should constant fold bswap (1(OVF)) but simply
> make the (OVF) sticky as done in other constant foldings.

Changing what fold-const-call.cc does at this point seems extremely risky to
me.  There are many different builtins, shall we propagate e.g.
TREE_OVERFLOW from INTEGER_CST operands to REAL_CST result, or vice versa,
etc.?  I think not folding those is the conservatively right answer, we
don't have time to analyze all those dozens of different builtins and all
their corner cases, and with OVF in there they aren't valid C or C++
constant expressions, so we don't need to fold those during GENERIC,
and in GIMPLE we drop the overflow flags and can fold those there then.

        Jakub

Reply via email to