diff options
author | Richard Biener <rguenther@suse.de> | 2017-04-25 12:15:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-04-25 12:15:44 +0000 |
commit | bed3fd4637d24e27b61fbd7f366e98a211080a0b (patch) | |
tree | 690cd4fd07d5f180a7f6871949ce641cfc7e1daf /gcc/tree-ssa-alias.c | |
parent | ca0b6141fa6a9c98939224ebc3b7ddc171df5b96 (diff) | |
download | gcc-bed3fd4637d24e27b61fbd7f366e98a211080a0b.zip gcc-bed3fd4637d24e27b61fbd7f366e98a211080a0b.tar.gz gcc-bed3fd4637d24e27b61fbd7f366e98a211080a0b.tar.bz2 |
re PR tree-optimization/80492 (Wrong code when unrolling a loop with inline asm and local regs)
2017-04-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/80492
* alias.c (compare_base_decls): Handle registers with asm
specification conservatively.
* tree-ssa-alias.c (decl_refs_may_alias_p): Handle
compare_base_decls returning dont-know properly.
* gcc.dg/pr80492.c: New testcase.
From-SVN: r247208
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 3f0c650..0dcb273 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1096,13 +1096,16 @@ decl_refs_may_alias_p (tree ref1, tree base1, { gcc_checking_assert (DECL_P (base1) && DECL_P (base2)); + int cmp = compare_base_decls (base1, base2); + /* If both references are based on different variables, they cannot alias. */ - if (compare_base_decls (base1, base2) == 0) + if (cmp == 0) return false; /* If both references are based on the same variable, they cannot alias if the accesses do not overlap. */ - if (!ranges_overlap_p (offset1, max_size1, offset2, max_size2)) + if (cmp == 1 + && !ranges_overlap_p (offset1, max_size1, offset2, max_size2)) return false; /* For components with variable position, the above test isn't sufficient, |