This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/65855] missing optimization: triangular numbers
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Apr 2015 09:15:04 +0000
- Subject: [Bug middle-end/65855] missing optimization: triangular numbers
- Auto-submitted: auto-generated
- References: <bug-65855-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65855
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2015-04-23
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
For some reason we can't compute the number of iterations of this loop which is
because we have to assume that
(long unsigned int) n_3(D) != 18446744073709551615
and for some reason we couldn't simplify that to true!?
if (!exit_must_be_taken && !POINTER_TYPE_P (type))
{
if (integer_nonzerop (iv0->step))
assumption = fold_build2 (NE_EXPR, boolean_type_node,
iv1->base, TYPE_MAX_VALUE (type));
if we fix that we fail in the following way:
(chrec_apply
(varying_loop = 1
)
(chrec = {1, +, {2, +, 1}_1}_1)
(x = (long unsigned int) n_3(D) + 18446744073709551615)
(res = scev_not_known))
not replacing:
t_4 = PHI <t_5(3)>
because we can't compute the final result expression.