This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/35292] Missing Const Prop -- union fields
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Jul 2012 14:05:00 +0000
- Subject: [Bug tree-optimization/35292] Missing Const Prop -- union fields
- Auto-submitted: auto-generated
- References: <bug-35292-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35292
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to work| |4.7.0
Resolution| |FIXED
Target Milestone|--- |4.7.0
Known to fail| |4.6.4
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-05 14:05:00 UTC ---
This is fixed in 4.7, done by FRE1:
Replaced u.cc.c[0] with 20 in D.1722_1 = u.cc.c[0];
Replaced (int) D.1722_1 with 20 in D.1723_2 = (int) D.1722_1;
Replaced u.cc.c[1] with 0 in D.1724_3 = u.cc.c[1];
Replaced (int) D.1724_3 with 0 in D.1725_4 = (int) D.1724_3;
Replaced D.1723_2 + D.1725_4 with 20 in D.1721_5 = D.1723_2 + D.1725_4;
foo (int i)
{
int D.1725;
char D.1724;
int D.1723;
char D.1722;
int D.1721;
<bb 2>:
u.ii = 20;
D.1722_1 = 20;
D.1723_2 = 20;
D.1724_3 = 0;
D.1725_4 = 0;
D.1721_5 = 20;
return D.1721_5;
}