summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authoreraman <eraman@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-20 18:34:59 +0000
committereraman <eraman@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-20 18:34:59 +0000
commit6a818150658228678dfd91bb919c6bd603b943fa (patch)
tree82b888cb47014836fd0f723d4bff154d61225312 /gcc/cfgexpand.c
parent452f8ae3fc5d9dfc8ede58636e43c7d3d5af996a (diff)
downloadgcc-6a818150658228678dfd91bb919c6bd603b943fa.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172788 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index a3abc8497df..e88bec14945 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -373,8 +373,9 @@ add_alias_set_conflicts (void)
to elements will conflict. In case of unions we have
to be careful as type based aliasing rules may say
access to the same memory does not conflict. So play
- safe and add a conflict in this case. */
- || contains_union)
+ safe and add a conflict in this case when
+ -fstrict-aliasing is used. */
+ || (contains_union && flag_strict_aliasing))
add_stack_var_conflict (i, j);
}
}