Commit 4a25752b by Easwaran Raman Committed by Easwaran Raman

cfgexpand.c (add_alias_set_conflicts): Add conflicts with a variable containing…

cfgexpand.c (add_alias_set_conflicts): Add conflicts with a variable containing union type only with -fstrict-aliasing.

2011-04-20  Easwaran Raman  <eraman@google.com>

	* cfgexpand.c (add_alias_set_conflicts): Add conflicts with a variable
	containing union type only with -fstrict-aliasing.

2011-04-20  Easwaran Raman  <eraman@google.com>

	* gcc.dg/stack-layout-1.c: New test.

From-SVN: r172788
parent 1809ba94
2011-04-20 Easwaran Raman <eraman@google.com>
* cfgexpand.c (add_alias_set_conflicts): Add conflicts with a variable
containing union type only with -fstrict-aliasing.
2011-04-20 Jim Meyering <meyering@redhat.com> 2011-04-20 Jim Meyering <meyering@redhat.com>
Remove useless if-before-free tests. Remove useless if-before-free tests.
......
...@@ -373,8 +373,9 @@ add_alias_set_conflicts (void) ...@@ -373,8 +373,9 @@ add_alias_set_conflicts (void)
to elements will conflict. In case of unions we have to elements will conflict. In case of unions we have
to be careful as type based aliasing rules may say to be careful as type based aliasing rules may say
access to the same memory does not conflict. So play access to the same memory does not conflict. So play
safe and add a conflict in this case. */ safe and add a conflict in this case when
|| contains_union) -fstrict-aliasing is used. */
|| (contains_union && flag_strict_aliasing))
add_stack_var_conflict (i, j); add_stack_var_conflict (i, j);
} }
} }
......
2011-04-20 Easwaran Raman <eraman@google.com>
* gcc.dg/stack-layout-1.c: New test.
2011-04-20 Daniel Jacobowitz <dan@codesourcery.com> 2011-04-20 Daniel Jacobowitz <dan@codesourcery.com>
* gcc.dg/vect/vect-shift-3.c, gcc.dg/vect/vect-shift-4.c: New. * gcc.dg/vect/vect-shift-3.c, gcc.dg/vect/vect-shift-4.c: New.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fno-strict-aliasing -fdump-rtl-expand" } */
union U {
int a;
float b;
};
struct A {
union U u1;
char a[100];
};
void bar (struct A *);
void foo ()
{
{
struct A a;
bar (&a);
}
{
struct A a;
bar (&a);
}
}
/* { dg-final { scan-rtl-dump-times "Partition" 1 "expand" } } */
/* { dg-final { cleanup-rtl-dump "expand" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment