https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110450
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2023-07-01 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- In VRP: trunk: ``` Folding statement: _11 = _9 % 11; Matching expression match.pd:2480, gimple-match-4.cc:35 Matching expression match.pd:2483, gimple-match-3.cc:66 Matching expression match.pd:2490, gimple-match-2.cc:58 Matching expression match.pd:1991, gimple-match-5.cc:23 Matching expression match.pd:2480, gimple-match-4.cc:35 Matching expression match.pd:2483, gimple-match-3.cc:66 Matching expression match.pd:2490, gimple-match-2.cc:58 Matching expression match.pd:1948, gimple-match-7.cc:20 Matching expression match.pd:2480, gimple-match-4.cc:35 Matching expression match.pd:2483, gimple-match-3.cc:66 Matching expression match.pd:2490, gimple-match-2.cc:58 Applying pattern match.pd:5319, gimple-match-8.cc:2688 Applying pattern match.pd:6000, gimple-match-10.cc:587 Applying pattern match.pd:2102, gimple-match-1.cc:6289 Applying pattern match.pd:6000, gimple-match-10.cc:587 Applying pattern match.pd:5284, gimple-match-4.cc:1099 Applying pattern match.pd:1378, gimple-match-3.cc:7680 Applying pattern match.pd:4720, gimple-match-1.cc:16033 gimple_simplified to _14 = a.1_2 <= 0; _15 = (int) _14; _11 = _15 << 3; Global Exported: _11 = [irange] int [0, 0][8, 8] NONZERO 0x8 Folded into: _11 = _15 << 3; ``` And the relationship between _5 and _11 is completely lost. while in GCC 13: ``` Folding statement: _11 = _9 % 11; Global Exported: _11 = [irange] int [0, 0][8, 8] NONZERO 0x8 Folded into: _11 = _9; ``` And then we remove the __builtin_unreachable even though we infer that _5 would be 0 and therefore _11 would never be 8 .