This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/38747] [4.4 Regression] Wrong code due to VIEW_CONVERT_EXPR
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2009 23:26:56 -0000
- Subject: [Bug tree-optimization/38747] [4.4 Regression] Wrong code due to VIEW_CONVERT_EXPR
- References: <bug-38747-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pinskia at gcc dot gnu dot org 2009-01-15 23:26 -------
Created an attachment (id=17111)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17111&action=view)
Patch which should fix this and PR 38748
This patch still creates VCE for INDIRECT_REF based but only if the aliasing
sets are the same.
This is to allow for the following to be optimized:
struct S { unsigned f; };
int __attribute__((noinline))
foo (float *r, struct S *p)
{
int *q = (int *)&p->f;
int i = *q;
*r = 0.0;
return i + *q;
}
Without a need for &p->f in the IR.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38747