https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116845
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Summary|gcc.dg/pr109393.c test |gcc.dg/pr109393.c test |fails |fails on ilp32 targets (and | |maybe others) Assignee|pinskia at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- In the ILP32 case we have: j.0_1 = (sizetype) j_11(D); _2 = j.0_1 + 1073741823; _3 = _2 * 4; k_12 = j_11(D) + -1; k.1_6 = (unsigned int) k_12; _7 = k.1_6 * 4; 1073741823 is -1u/4 But the upper 2 bits of -1u/4 does not matter as they get pushed out by the *4. so we need another canonicalization here. (a + CST0) * powerof2 -> (a + CST0`) * CST1 sign extend the last N bits for CST0. I have other things going on so I am not going to implement this but this should get someone started here. and it shows the problem of canonicalization dealing with powerof2 multiplies and mod math :).