summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-10-17 15:42:19 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-10-17 15:42:19 +0000
commit816c4ba228ea728c3e07161528b8781d61e9af7f (patch)
tree1b43748ad2550e4903e72fa1abe9d046f47f6488 /gcc/alias.c
parentf419fd1f8fcb77978b70225f670167a91b323893 (diff)
downloadgcc-816c4ba228ea728c3e07161528b8781d61e9af7f.tar.gz
[PATCH, middle-end/82577] Fix DECL_ASSEMBLER_NAME ICE
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01067.html gcc/ PR middle-end/82577 * alias.c (compare_base_decls): Check HAS_DECL_ASSEMBLER_NAME_P, use DECL_ASSEMBLER_NAME_RAW. gcc/testsuite/ PR middle-end/82577 * g++.dg/opt/pr82577.C: New. From-SVN: r253819
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index e4865729a9b..cb57c6a10ff 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2047,13 +2047,15 @@ compare_base_decls (tree base1, tree base2)
return 1;
/* If we have two register decls with register specification we
- cannot decide unless their assembler name is the same. */
+ cannot decide unless their assembler names are the same. */
if (DECL_REGISTER (base1)
&& DECL_REGISTER (base2)
+ && HAS_DECL_ASSEMBLER_NAME_P (base1)
+ && HAS_DECL_ASSEMBLER_NAME_P (base2)
&& DECL_ASSEMBLER_NAME_SET_P (base1)
&& DECL_ASSEMBLER_NAME_SET_P (base2))
{
- if (DECL_ASSEMBLER_NAME (base1) == DECL_ASSEMBLER_NAME (base2))
+ if (DECL_ASSEMBLER_NAME_RAW (base1) == DECL_ASSEMBLER_NAME_RAW (base2))
return 1;
return -1;
}