This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13835] New: [tree-ssa] Several loops detected instead of a single one
- From: "spop at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2004 18:18:41 -0000
- Subject: [Bug optimization/13835] New: [tree-ssa] Several loops detected instead of a single one
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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})
{
<bb 0>:
goto <bb 2> (<L1>);
}
bb_5 (preds = {bb_4}, succs = {bb_-2})
{
<L5>:;
return;
}
loop_1
{
bb_6 (preds = {bb_1}, succs = {bb_2})
{
<L6>:;
}
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)>;
<L1>:;
a_33 = a_3 + b_4;
goto <bb 4> (<L3>);
}
loop_2
{
bb_1 (preds = {bb_4}, succs = {bb_3, bb_6})
{
<L0>:;
if (a_2 <= 29) goto <L6>; else goto <L2>;
}
bb_3 (preds = {bb_1}, succs = {bb_4})
{
<L2>:;
a_36 = a_2 + c_35;
}
bb_4 (preds = {bb_3, bb_2}, succs = {bb_5, bb_1})
{
# c_23 = PHI <c_22(2), c_35(3)>;
# b_1 = PHI <b_4(2), b_34(3)>;
# a_2 = PHI <a_33(2), a_36(3)>;
<L3>:;
b_34 = b_1 + 1;
c_35 = c_23 + 1;
if (a_2 != 0) goto <L0>; else goto <L5>;
}
}
}
}
--
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