This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17133] [3.5 Regression] wrong code with -ftree-lim
- From: "rakdver at atrey dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2004 21:19:40 -0000
- Subject: [Bug tree-optimization/17133] [3.5 Regression] wrong code with -ftree-lim
- References: <20040821205808.17133.belyshev@lubercy.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rakdver at atrey dot karlin dot mff dot cuni dot cz 2004-09-01 21:19 -------
Subject: Re: [3.5 Regression] wrong code with -ftree-lim
Hello,
> Zdenek, please take a look at this bug, it prevents emacs from working.
the problem is as follows. This is the body of the loop before lim:
# foo_1 = PHI <foo_2(0), foo_20(3)>;
<L0>:;
# VUSE <bar_3>;
bar.0_4 = bar;
# VUSE <foo_1>;
foo.1_5 = foo;
foo.2_6 = (unsigned int) foo.1_5;
foo.3_7 = (void *) foo.2_6;
T.4_8 = bar.0_4 + foo.3_7;
T.5_9 = (int) T.4_8;
T.6_10 = (unsigned int) T.5_9;
T.7_11 = T.6_10 & 0fffffffe;
res_12 = (void *) T.7_11;
T.8_14 = foo.1_5 + 2;
# V_MUST_DEF <foo_15>;
foo = T.8_14;
foo.2_17 = (unsigned int) T.8_14;
# VUSE <baz_18>;
baz.9_19 = baz;
if (foo.2_17 < baz.9_19) goto <L1>; else goto <L2>;
# SUCC: 3 [90.0%] (false,exec) 2 [10.0%] (true,exec)
# BLOCK 2
# PRED: 1 [10.0%] (true,exec)
<L1>:;
return res_12;
# SUCC: EXIT [100.0%]
# BLOCK 3
# PRED: 1 [90.0%] (false,exec)
<L2>:;
# V_MUST_DEF <foo_20>;
foo = 0;
goto <bb 1> (<L0>);
# SUCC: 1 [100.0%] (fallthru,dfs_back,exec)
Note that foo_15 is not used anywhere; then lim has currently no way how to
learn about the foo = T.8_14 statement, since it only traces def and
use chains from the phi node defining foo_1. Ooops....
I currently do not know how to fix it, I will think about what the
correct solution is.
Zdenek
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17133