https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109505
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Target Milestone|12.3 |--- Component|c++ |middle-end Ever confirmed|0 |1 Last reconfirmed|2023-04-13 00:00:00 |2023-04-14 Summary|[12/13 Regression] Compiler |(t | 15) & svcntb() causes |loops forever to OOM while |an OOM/ICE |compiling | |evaluate_prg_hwy.cc and SVE | Known to fail| |11.1.0, 13.0 --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Simple reduced testcase: ``` #include <arm_sve.h> unsigned long f(unsigned long tt) { unsigned long t= svcntb(); return (tt | 15) & t; } ``` Confirmed. Fails even in GCC 11.1.0. It is due to match.pd's /* (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2) */ (simplify (bit_and (bit_ior @0 CONSTANT_CLASS_P@1) CONSTANT_CLASS_P@2) (bit_ior (bit_and @0 @2) (bit_and @1 @2))) POLY_INT_CST is a CONSTANT_CLASS but does not simplify on the bit_and. So maybe it should include a ! on the (bit_and @1 @2) .