[Bug tree-optimization/125786] [13/14/15/16/17 Regression] wrong code (SIGFPE) at -O2 on x86_64-linux-gnu

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 15 08:46:33 GMT 2026


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'll note we have

/* (@0 ? @2 : @3) lop (@1 ? @2 : @3)  -->  (@0 lop @1) ? @2 : @3.  */
(for lop (bit_and bit_ior bit_xor)
   (simplify
   (lop
      (vec_cond @0 integer_minus_onep@2 integer_zerop@3)
      (vec_cond @1 @2 @3))
      (if (target_supports_op_p (TREE_TYPE (@0), lop, optab_vector))
   (vec_cond (lop @0 @1) @2 @3))))

that would catch the testcase, but we do not support the logical op here
and the reassoc pass does not bother to verify (ick).  That's a different
issue.

Also inverted value matching is broken (missed opt), have a patch for that.


More information about the Gcc-bugs mailing list