public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/47653] [4.6 Regression] gcc.c-torture/execute/930614-2.c FAILs with -fstack-check=generic -fgraphite-identity Date: Fri, 18 Feb 2011 16:04:00 -0000 [thread overview] Message-ID: <bug-47653-4-I1oPsCLz4A@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-47653-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47653 Jeffrey A. Law <law at redhat dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 CC| |law at redhat dot com AssignedTo|unassigned at gcc dot |spop at gcc dot gnu.org |gnu.org | --- Comment #2 from Jeffrey A. Law <law at redhat dot com> 2011-02-18 15:36:46 UTC --- This appears to be a bug in the graphite transformations. Prior to graphite transformations we have the following function with two nested loops: # BLOCK 2 freq:139 # PRED: ENTRY [100.0%] (fallthru,exec) # .MEM_13 = VDEF <.MEM_12(D)> saved_stack.1_3 = __builtin_stack_save (); # .MEM_14 = VDEF <.MEM_13> x.0_4 = __builtin_alloca (256); goto <bb 8>; # SUCC: 8 [100.0%] (fallthru,exec) # BLOCK 3 freq:7901 # PRED: 4 [88.9%] (true,exec) # SUCC: 4 [100.0%] (fallthru,exec) # BLOCK 4 freq:8889 # PRED: 3 [100.0%] (fallthru,exec) 9 [100.0%] (fallthru,exec) # j_23 = PHI <j_7(3), j_5(9)> # .MEM_24 = PHI <.MEM_15(3), .MEM_6(9)> # .MEM_15 = VDEF <.MEM_24> *x.0_4[j_5][j_23] = 0; j_7 = j_23 + 1; if (j_7 <= 7) goto <bb 3>; else goto <bb 5>; # SUCC: 3 [88.9%] (true,exec) 5 [11.1%] (false,exec) # BLOCK 5 freq:988 # PRED: 4 [11.1%] (false,exec) # .MEM_19 = PHI <.MEM_15(4)> # SUCC: 6 [100.0%] (fallthru,exec) # BLOCK 6 freq:1111 # PRED: 5 [100.0%] (fallthru,exec) 8 [11.1%] (false,exec) # .MEM_25 = PHI <.MEM_19(5), .MEM_6(8)> i_8 = j_5 + 1; if (i_8 <= 7) goto <bb 7>; else goto <bb 10>; # SUCC: 7 [88.9%] (true,exec) 10 [11.1%] (false,exec) # BLOCK 7 freq:988 # PRED: 6 [88.9%] (true,exec) # SUCC: 8 [100.0%] (fallthru,exec) # BLOCK 8 freq:1111 # PRED: 7 [100.0%] (fallthru,exec) 2 [100.0%] (fallthru,exec) # j_5 = PHI <i_8(7), 0(2)> # .MEM_6 = PHI <.MEM_25(7), .MEM_14(2)> if (j_5 <= 7) goto <bb 9>; else goto <bb 6>; # SUCC: 9 [88.9%] (true,exec) 6 [11.1%] (false,exec) # BLOCK 9 freq:988 # PRED: 8 [88.9%] (true,exec) goto <bb 4>; # SUCC: 4 [100.0%] (fallthru,exec) # BLOCK 10 freq:139 # PRED: 6 [11.1%] (false,exec) # .MEM_16 = VDEF <.MEM_25> __builtin_stack_restore (saved_stack.1_3); return 0; # SUCC: EXIT [100.0%] Pretty simple stuff. Graphite transforms it into: # BLOCK 2 freq:313 # PRED: ENTRY [100.0%] (fallthru,exec) # .MEM_13 = VDEF <.MEM_12(D)> saved_stack.1_3 = __builtin_stack_save (); # .MEM_14 = VDEF <.MEM_13> x.0_4 = __builtin_alloca (256); # SUCC: 3 [100.0%] (fallthru) # BLOCK 3 freq:2500 # PRED: 2 [100.0%] (fallthru) 8 [100.0%] (fallthru,dfs_back) # graphite_IV.5_11 = PHI <0(2), graphite_IV.5_1(8)> # .MEM_33 = PHI <.MEM_14(2), .MEM_34(8)> D.2701_22 = 8 - graphite_IV.5_11; D.2702_21 = D.2701_22 > 0; if (D.2702_21 != 0) goto <bb 4>; else goto <bb 7>; # SUCC: 4 [50.0%] (true) 7 [50.0%] (false) # BLOCK 4 freq:1250 # PRED: 3 [50.0%] (true) D.2704_10 = (<unnamed-signed:64>) graphite_IV.5_11; D.2705_2 = D.2704_10 * 4294967295; D.2706_18 = D.2705_2 + 7; # SUCC: 5 [100.0%] (fallthru) # BLOCK 5 freq:10000 # PRED: 4 [100.0%] (fallthru) 6 [100.0%] (fallthru,dfs_back) # graphite_IV.6_17 = PHI <0(4), graphite_IV.6_26(6)> # .MEM_35 = PHI <.MEM_33(4), .MEM_27(6)> D.2707_28 = (int) graphite_IV.5_11; D.2708_29 = (int) graphite_IV.5_11; D.2709_30 = (int) graphite_IV.6_17; D.2710_31 = D.2708_29 + D.2709_30; # .MEM_27 = VDEF <.MEM_35> *x.0_4[D.2707_28][D.2710_31] = 0; graphite_IV.6_26 = graphite_IV.6_17 + 1; if (graphite_IV.6_17 < D.2706_18) goto <bb 6>; else goto <bb 7>; # SUCC: 6 [87.5%] (true) 7 [12.5%] (loop_exit,false) # BLOCK 6 freq:8750 # PRED: 5 [87.5%] (true) goto <bb 5>; # SUCC: 5 [100.0%] (fallthru,dfs_back) # BLOCK 7 freq:2500 # PRED: 5 [12.5%] (loop_exit,false) 3 [50.0%] (false) # .MEM_34 = PHI <.MEM_27(5), .MEM_33(3)> graphite_IV.5_1 = graphite_IV.5_11 + 1; if (graphite_IV.5_11 < 7) goto <bb 8>; else goto <bb 9>; # SUCC: 8 [87.5%] (true) 9 [12.5%] (loop_exit,false) # BLOCK 8 freq:2188 # PRED: 7 [87.5%] (true) goto <bb 3>; # SUCC: 3 [100.0%] (fallthru,dfs_back) # BLOCK 9 freq:313 # PRED: 7 [12.5%] (loop_exit,false) # .MEM_32 = PHI <.MEM_34(7)> # .MEM_16 = VDEF <.MEM_32> __builtin_stack_restore (saved_stack.1_3); return 0; # SUCC: EXIT [100.0%] Of particular interest is the assignment to D.2705_2 in block #4: D.2705_2 = D.2704_10 * 4294967295; D.2706_18 = D.2705_2 + 7; That makes absolutely no sense. Particularly since D.2706_18 is later used to control loop termination in BB5. Note D.2706 is a 64bit type, so we really are multiplying by 4294967295. Needless to say this causes the loop termination condition to do something different than was originally intended.
next prev parent reply other threads:[~2011-02-18 15:37 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-02-09 0:43 [Bug middle-end/47653] New: " zsojka at seznam dot cz 2011-02-09 4:02 ` [Bug middle-end/47653] " hjl.tools at gmail dot com 2011-02-18 16:04 ` law at redhat dot com [this message] 2011-02-18 16:59 ` spop at gcc dot gnu.org 2011-02-18 18:50 ` spop at gcc dot gnu.org 2011-03-25 19:56 ` [Bug middle-end/47653] [4.6/4.7 " jakub at gcc dot gnu.org 2011-06-27 15:56 ` jakub at gcc dot gnu.org 2011-06-29 21:19 ` spop at gcc dot gnu.org 2011-07-25 17:46 ` spop at gcc dot gnu.org 2011-07-25 17:48 ` spop at gcc dot gnu.org 2011-07-26 18:49 ` spop at gcc dot gnu.org 2011-07-26 18:50 ` spop at gcc dot gnu.org 2011-07-26 18:57 ` spop at gcc dot gnu.org 2011-08-09 15:52 ` ro at gcc dot gnu.org 2011-08-11 13:45 ` matz 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-47653-4-I1oPsCLz4A@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).