https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114074
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=114052
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
Keywords| |wrong-code
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Possibly related to the other bug showing issues with
infer_loop_bounds_from_signedness. OTOH:
Analyzing # of iterations of loop 1
exit condition -2 <= [-2, + , -2](no_overflow)
bounds on difference of bases: 0 ... 0
result:
# of iterations 1, bounded by 1
Loop 1 iterates 1 times.
Loop 1 iterates at most 0 times.
Loop 1 likely iterates at most 0 times.
Analyzing # of iterations of loop 1
exit condition -2 <= [-2, + , -2](no_overflow)
bounds on difference of bases: 0 ... 0
result:
# of iterations 1, bounded by 1
Removed pointless exit: if (_4 >= -2)
we incorrectly (looking at the IL) determine the exit will be taken in the
first iteration somehow. Not sure where that other upper bound comes from,
but we have it zero upon entry of the pass already.
CDDCE has
Induction variable (int) -1 + 2 * iteration does not wrap in statement _1 =
~a.4_18;
in loop 1.
Statement _1 = ~a.4_18;
is executed at most 1 (bounded by 1) + 1 times in loop 1.
Induction variable (int) -2147480647 + -6002(OVF) * iteration does not wrap in
statement _2 = _1 * 2147480647;
in loop 1.
Statement _2 = _1 * 2147480647;
is executed at most 0(OVF) (bounded by 0) + 1 times in loop 1.
ranges look somewhat odd (_4 starts at -4 but the merge PHI a.4_18 only at -2),
but not necessarily wrong. So this might also be a SCEV issue computing
that odd IV for _2.