public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/65855] missing optimization: triangular numbers Date: Fri, 23 Oct 2015 12:42:00 -0000 [thread overview] Message-ID: <bug-65855-4-GwRWc9NCWU@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-65855-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65855 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |spop at gcc dot gnu.org --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- Looks like SCEV analysis is broken for this case. <bb 3>: # t_11 = PHI <0(5), t_5(7)> # i_13 = PHI <1(5), i_6(7)> t_5 = t_11 + i_13; i_6 = i_13 + 1; if (i_6 <= _10) goto <bb 7>; else goto <bb 8>; <bb 7>: goto <bb 3>; <bb 8>: # t_2 = PHI <t_5(3)> t_11 = { 0, +, i_13 }_1 (ok) i_13 = {1, +, 1}_1 (ok) (instantiate_scev (instantiate_below = 5) (evolution_loop = 1) (chrec = {0, +, i_13}_1) (analyze_scalar_evolution (loop_nb = 1) (scalar = i_13) (get_scalar_evolution (scalar = i_13) (scalar_evolution = {1, +, 1}_1)) (set_scalar_evolution instantiated_below = 5 (scalar = i_13) (scalar_evolution = {1, +, 1}_1)) ) (res = {0, +, {1, +, 1}_1}_1)) (instantiate_scev (instantiate_below = 5) (evolution_loop = 1) (chrec = {1, +, 1}_1) (res = {1, +, 1}_1)) (set_scalar_evolution instantiated_below = 5 (scalar = t_5) (scalar_evolution = {1, +, {2, +, 1}_1}_1)) not sure where the latter result comes from. It comes from #10 0x0000000000eac871 in scev_const_prop () at /space/rguenther/src/svn/trunk/gcc/tree-scalar-evolution.c:3456 3456 NULL); (gdb) l 3451 if (!POINTER_TYPE_P (type) 3452 && !INTEGRAL_TYPE_P (type)) 3453 continue; 3454 3455 ev = resolve_mixers (loop, analyze_scalar_evolution (loop, name), 3456 NULL); analyzing the evolution of t_2. So we end up looking at t_5 = t_11 + i_13 which is {0, +, {1,+, 1}_1}_1 + {1,+,1}_1 but that isn't {1, +, {2, +, 1}_1 }_1 as chrec_fold_plus_poly_poly maintains? But maybe this kind of CHREC is just ill-formed in the first place? Sebastian, any ideas here?
next prev parent reply other threads:[~2015-10-23 12:42 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-04-23 4:52 [Bug c/65855] New: " shawn at churchofgit dot com 2015-04-23 5:32 ` [Bug middle-end/65855] " pinskia at gcc dot gnu.org 2015-04-25 4:26 ` shawn at churchofgit dot com 2015-04-27 12:11 ` rguenth at gcc dot gnu.org 2015-10-23 12:05 ` rguenth at gcc dot gnu.org 2015-10-23 12:42 ` rguenth at gcc dot gnu.org [this message] 2021-08-07 6:42 ` [Bug middle-end/65855] SCEV / SCCP " pinskia at gcc dot gnu.org 2021-08-28 23:42 ` pinskia at gcc dot gnu.org 2023-06-10 16:02 ` pinskia at gcc dot gnu.org 2023-11-22 0:09 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-65855-4-GwRWc9NCWU@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).