diff options
author | abel <abel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-12 11:50:22 +0000 |
---|---|---|
committer | abel <abel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-12 11:50:22 +0000 |
commit | b95fdaae1b09febf9c76d7e68e34ee682bc90da9 (patch) | |
tree | ec94cb477663065002f939faa0fb8777d95a11f5 /gcc | |
parent | 0266d75cdea0b4faaead7bc55388fd06cceb911c (diff) | |
download | gcc-b95fdaae1b09febf9c76d7e68e34ee682bc90da9.tar.gz |
2009-08-12 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/41033
* alias.c (nonoverlapping_component_refs_p): Punt if strict aliasing is disabled.
2009-08-12 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/41033
* gcc.dg/pr41033.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150680 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/alias.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr41033.c | 24 |
4 files changed, 38 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d146a2efe08..335436f56e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-08-12 Andrey Belevantsev <abel@ispras.ru> + + PR rtl-optimization/41033 + * alias.c (nonoverlapping_component_refs_p): Punt when strict + aliasing is disabled. + 2009-08-11 Adam Nemet <anemet@caviumnetworks.com> * config/mips/predicates.md (qi_mask_operand, hi_mask_operand, diff --git a/gcc/alias.c b/gcc/alias.c index fc259b8ef2d..442be827a75 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1980,6 +1980,9 @@ nonoverlapping_component_refs_p (const_tree x, const_tree y) { const_tree fieldx, fieldy, typex, typey, orig_y; + if (!flag_strict_aliasing) + return false; + do { /* The comparison has to be done at a common type, since we don't diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a6e5bea1d3c..11309d89c98 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-08-12 Richard Guenther <rguenther@suse.de> + + PR rtl-optimization/41033 + * gcc.dg/pr41033.c: New test. + 2009-08-11 Janus Weil <janus@gcc.gnu.org> PR fortran/41022 diff --git a/gcc/testsuite/gcc.dg/pr41033.c b/gcc/testsuite/gcc.dg/pr41033.c new file mode 100644 index 00000000000..5043be2d119 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr41033.c @@ -0,0 +1,24 @@ +/* { dg-options "-O1 -fno-strict-aliasing" } */ +/* PR rtl-optimization/41033 */ + +struct X { + int i; + int j; +}; + +int foo(struct X *p, struct X *q) +{ + p->j = 1; + q->i = 0; + return p->j; +} + +extern void abort (void); + +int main() +{ + struct X x; + if (foo (&x, (struct X *)&x.j) != 0) + abort (); + return 0; +} |