aboutsummaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-04-25 12:15:44 +0000
committerRichard Biener <rguenther@suse.de>2017-04-25 12:15:44 +0000
commit81e9eaa672865b6c6731b9baa4c31fe08292c73c (patch)
tree690cd4fd07d5f180a7f6871949ce641cfc7e1daf /gcc/alias.c
parenta499a7b54fd8195cf971f2c3ad60157a7a44d9f4 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@247208 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c12
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)