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/28807] [4.2 Regression] wrong code with may_alias and structs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-08-23 08:06 -------
(In reply to comment #4)
> This is a hard nut to crack, my *guess* is that if you just check the
> alias set of the type of the access, we are going to end up claiming any
> access to a structure containing a char variable is aliased.
You are correct as we regress with the following testcase:
struct a
{
  char a1;
};

int *aa;

void g(int *a)
{
  aa = a;
  *a = 2;
}

int t(int i, struct a *b)
{
  g(&i);
  b->a1 = 1;
  i = 2;
  if (b->a1 != 1)
    link_failure ();
}
int main(void)
{
  struct a b;
  t(1, &b);
  return 0;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28807


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