https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98137
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Last reconfirmed| |2020-12-04 Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Ah, so the issue is that /* Split the unconverted operand and try to prove that wrapping isn't a problem. */ tree tmp_var, tmp_off; split_constant_offset (op0, &tmp_var, &tmp_off, cache, limit); /* See whether we have an SSA_NAME whose range is known to be [A, B]. */ if (TREE_CODE (tmp_var) != SSA_NAME) return false; we end up with tmp_var as MULT_EXPR (l_n_189 * 10). We can fix that by retaining the original code when splitting the constant offset returns zero. While this makes us match up (_286 + 1) * 8 and (_286 + 2) * 8 it fails to catch (_286 + 0) * 8 because that now is no longer expanded. But we can use determine_value_range instead of get_value_range to also handle expression trees. That fixes the testcase.