https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106630
--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Works with -fno-thread-jumps or with -fdisable-tree-dom3.
I haven't investigated whether the threading done in DOM2 is generating invalid
IL, but it looks like this match.pd pattern is going around in circles:
/* (A * C) +- (B * C) -> (A+-B) * C and (A * C) +- A -> A * (C+-1).
Modeled after fold_plusminus_mult_expr. */
(if (!TYPE_SATURATING (type)
&& (!FLOAT_TYPE_P (type) || flag_associative_math))
(for plusminus (plus minus)
...
...