This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/28807] [4.2 Regression] wrong code with may_alias and structs
- 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: 23 Aug 2006 08:06:34 -0000
- Subject: [Bug tree-optimization/28807] [4.2 Regression] wrong code with may_alias and structs
- References: <bug-28807-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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