This appropriately guards the check for a hard register in
compare_base_decls which otherwise ICEs when passed a CONST_DECL.
2020-09-23 Richard Biener <rguenther@suse.de>
PR middle-end/97162
* alias.c (compare_base_decls): Use DECL_HARD_REGISTER
and guard with VAR_P.
/* If we have two register decls with register specification we
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)
+ if (VAR_P (base1)
+ && VAR_P (base2)
+ && DECL_HARD_REGISTER (base1)
+ && DECL_HARD_REGISTER (base2)
&& DECL_ASSEMBLER_NAME_SET_P (base1)
&& DECL_ASSEMBLER_NAME_SET_P (base2))
{