This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/28545] [4.1 Regression] Wrong code for hoisted multiplication
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Oct 2006 10:40:52 -0000
- Subject: [Bug middle-end/28545] [4.1 Regression] Wrong code for hoisted multiplication
- References: <bug-28545-7172@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from rguenth at gcc dot gnu dot org 2006-10-14 10:40 -------
Much simpler testcase:
void foo(int);
void solver(int cr)
{
int x, y, n;
for (y = 0; y < cr; y++)
for (x = 0; x < cr; x++) {
for (n = 0; n < cr; n++)
;
foo(cr*cr);
}
}
t35.copyprop1:
;; Function solver (solver)
solver (cr)
{
int n;
int y;
int x;
int D.1293;
<bb 0>:
goto <bb 6> (<L7>);
<L2>:;
n_11 = n_3 + 1;
# n_3 = PHI <0(4), n_11(1)>;
<L3>:;
if (n_3 < cr_5) goto <L2>; else goto <L4>;
<L4>:;
D.1293_9 = cr_5 * cr_5;
foo (D.1293_9);
x_10 = x_1 + 1;
# x_1 = PHI <0(6), x_10(3)>;
<L5>:;
if (x_1 < cr_5) goto <L3>; else goto <L6>;
<L6>:;
y_7 = y_2 + 1;
# y_2 = PHI <0(0), y_7(5)>;
<L7>:;
if (y_2 < cr_5) goto <L5>; else goto <L8>;
<L8>:;
return;
}
t36.vrp1:
solver (cr)
{
int n;
int y;
int x;
int D.1293;
<bb 0>:
goto <bb 6> (<L7>);
<L2>:;
n_11 = n_3 + 1;
# n_3 = PHI <0(4), n_11(1)>;
<L3>:;
if (n_3 < cr_5) goto <L2>; else goto <L4>;
<L4>:;
D.1293_9 = cr_5 * cr_13;
foo (D.1293_9);
x_10 = x_1 + 1;
# x_1 = PHI <0(6), x_10(3)>;
<L5>:;
if (x_1 < cr_5) goto <L3>; else goto <L6>;
<L6>:;
y_7 = y_2 + 1;
# y_2 = PHI <0(0), y_7(5)>;
<L7>:;
if (y_2 < cr_5) goto <L5>; else goto <L8>;
<L8>:;
return;
}
(this smells like a tree sharing issue).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28545