diff options
author | Jeff Law <law@redhat.com> | 2006-04-10 23:52:45 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2006-04-10 23:52:45 -0600 |
commit | cf282d0a4a9174888fd9add60d26acfac1601a0e (patch) | |
tree | 8f3fb1be74c0d398df2d5f881cf972cd746e2d0b /gcc | |
parent | b3b2cbc4fad08189660fe2aba344227b653891bb (diff) | |
download | gcc-cf282d0a4a9174888fd9add60d26acfac1601a0e.zip gcc-cf282d0a4a9174888fd9add60d26acfac1601a0e.tar.gz gcc-cf282d0a4a9174888fd9add60d26acfac1601a0e.tar.bz2 |
tree-ssa-copy.c (may_propagate_copy): Test flow sensitive alias information too.
PR/27087
* tree-ssa-copy.c (may_propagate_copy): Test flow sensitive
alias information too.
* gcc.c-torture/compile/pr27087.c: New test.
From-SVN: r112849
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr27087.c | 23 | ||||
-rw-r--r-- | gcc/tree-ssa-copy.c | 15 |
4 files changed, 49 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c5aa369..0588113 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-04-03 Jeff Law <law@redhat.com> + + PR/27087 + * tree-ssa-copy.c (may_propagate_copy): Test flow sensitive + alias information too. + 2006-04-10 Mike Frysinger <vapier@gentoo.org> * gcc/Makefile.in (gcc-cross): Add $(exeext) to target name. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 237a690..f71c86b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Jeff Law <law@redhat.com> + + PR/27087 + * gcc.c-torture/compile/pr27087.c: New test. + 2006-04-10 Aldy Hernandez <aldyh@redhat.com> PR/21391 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr27087.c b/gcc/testsuite/gcc.c-torture/compile/pr27087.c new file mode 100644 index 0000000..3add13b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr27087.c @@ -0,0 +1,23 @@ +extern int ptbl[4]; +extern int ctbl[4]; + +void doViews(void) { + int *c = ctbl, *p = ptbl; + while (1) + { + p++; + c++; + if (*p) + { + if (c == p) + { + if (*c) + return; + } + else + return; + } + } + + g(); +} diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index fca44d76..f1b67b5b 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -117,6 +117,21 @@ may_propagate_copy (tree dest, tree orig) else if (get_alias_set (TREE_TYPE (type_d)) != get_alias_set (TREE_TYPE (type_o))) return false; + + /* Also verify flow-sensitive information is compatible. */ + if (SSA_NAME_PTR_INFO (orig) && SSA_NAME_PTR_INFO (dest)) + { + struct ptr_info_def *orig_ptr_info = SSA_NAME_PTR_INFO (orig); + struct ptr_info_def *dest_ptr_info = SSA_NAME_PTR_INFO (dest); + + if (orig_ptr_info->name_mem_tag + && dest_ptr_info->name_mem_tag + && orig_ptr_info->pt_vars + && dest_ptr_info->pt_vars + && !bitmap_intersect_p (dest_ptr_info->pt_vars, + orig_ptr_info->pt_vars)) + return false; + } } /* If the destination is a SSA_NAME for a virtual operand, then we have |