From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20965 invoked by alias); 23 Jan 2004 18:18:42 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20887 invoked by uid 48); 23 Jan 2004 18:18:41 -0000 Date: Fri, 23 Jan 2004 18:18:00 -0000 From: "spop at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040123181835.13835.spop@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/13835] New: [tree-ssa] Several loops detected instead of a single one X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg02958.txt.bz2 List-Id: Hi, That's another bug I'm seeing after the merge of the tree-ssa to lno from 2004-01-20. I cannot fix the following testcast from the scalar evolution analysis testsuite: ----------------------------------------------- bool foo (int); int main (void) { int a = -100; int b = 2; int c = 3; while (a) { /* Exercises if-phi-nodes. */ if (foo (a)) a += b; else a += c; b++; c++; } } ----------------------------------------------- because instead of having a single loop as everybody would have expected, for the above snipet, I get two nested loops. I suspect the dom-pass, for having unsafely transformed the program, but that's just a guess. I haven't investigated the real causes of this bug yet. The following representation has been dumped using the usual debug_loop_ir () loop_0 { bb_0 (preds = {bb_-1}, succs = {bb_2}) { : goto (); } bb_5 (preds = {bb_4}, succs = {bb_-2}) { :; return; } loop_1 { bb_6 (preds = {bb_1}, succs = {bb_2}) { :; } bb_2 (preds = {bb_6, bb_0}, succs = {bb_4}) { # c_22 = PHI <3(0), c_35(6)>; # b_4 = PHI <2(0), b_34(6)>; # a_3 = PHI <-100(0), a_2(6)>; :; a_33 = a_3 + b_4; goto (); } loop_2 { bb_1 (preds = {bb_4}, succs = {bb_3, bb_6}) { :; if (a_2 <= 29) goto ; else goto ; } bb_3 (preds = {bb_1}, succs = {bb_4}) { :; a_36 = a_2 + c_35; } bb_4 (preds = {bb_3, bb_2}, succs = {bb_5, bb_1}) { # c_23 = PHI ; # b_1 = PHI ; # a_2 = PHI ; :; b_34 = b_1 + 1; c_35 = c_23 + 1; if (a_2 != 0) goto ; else goto ; } } } } -- Summary: [tree-ssa] Several loops detected instead of a single one Product: gcc Version: tree-ssa Status: UNCONFIRMED Severity: critical Priority: P2 Component: optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: spop at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13835