This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/38747] [4.4 Regression] Wrong code due to VIEW_CONVERT_EXPR



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]