This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP
- 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: 25 May 2007 10:21:40 -0000
- Subject: [Bug tree-optimization/31981] Missed forw prop with indirect ref and addr. due to CCP
- References: <bug-31981-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2007-05-25 11:21 -------
Indeed with -fno-tree-ccp the testcase is optimized by forwprop1 to
<bb 2>:
D.2000_3 = i_2(D) * 4;
D.2001_4 = (int *) D.2000_3;
D.2002_5 = &b.t[i_2(D)];
*D.2002_5 = 1;
return;
and then by forwprop2 to
<bb 2>:
D.2002_5 = &b.t[i_2(D)];
b.t[i_2(D)] = 1;
return;
so the right fix is to eventually teach CCP to do the first transformation,
or rather teach fold_stmt to do a little tree combining in this case. Ugh.
Or avoid this particular type of CCP. Ugh.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Missed forw prop with |Missed forw prop with
|indirect ref and addr. |indirect ref and addr. due
| |to CCP
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31981