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/alias.c | |
parent | ca0b6141fa6a9c98939224ebc3b7ddc171df5b96 (diff) |
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/alias.c')
-rw-r--r-- | gcc/alias.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/alias.c b/gcc/alias.c index efd89ce1679..e16e3501522 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2046,6 +2046,18 @@ compare_base_decls (tree base1, tree base2) if (base1 == base2) return 1; + /* If we have two register decls with register specification we + cannot decide unless their assembler name is the same. */ + if (DECL_REGISTER (base1) + && DECL_REGISTER (base2) + && DECL_ASSEMBLER_NAME_SET_P (base1) + && DECL_ASSEMBLER_NAME_SET_P (base2)) + { + if (DECL_ASSEMBLER_NAME (base1) == DECL_ASSEMBLER_NAME (base2)) + return 1; + return -1; + } + /* Declarations of non-automatic variables may have aliases. All other decls are unique. */ if (!decl_in_symtab_p (base1) |