diff options
author | Bin Cheng <bin.cheng@arm.com> | 2019-01-23 22:43:42 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2019-01-23 22:43:42 +0000 |
commit | 76ca8d0f4a9873953244792b20e5ca51f4a88c65 (patch) | |
tree | 997761802a06d812dcfe86b678ee46cf61e26e82 /gcc/recog.c | |
parent | 6395ba73f84930d5ebcf692a3bd570da600f9da9 (diff) | |
download | gcc-76ca8d0f4a9873953244792b20e5ca51f4a88c65.zip gcc-76ca8d0f4a9873953244792b20e5ca51f4a88c65.tar.gz gcc-76ca8d0f4a9873953244792b20e5ca51f4a88c65.tar.bz2 |
re PR target/85711 (ICE in aarch64_classify_address, at config/aarch64/aarch64.c:5678)
2019-01-23 Bin Cheng <bin.cheng@arm.com>
Steve Ellcey <sellcey@marvell.com>
PR target/85711
* recog.c (address_operand): Return false on wrong mode for address.
(constrain_operands): Check for mode with 'p' constraint.
Co-Authored-By: Steve Ellcey <sellcey@marvell.com>
From-SVN: r268219
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index d0c498f..a9f584b 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1070,6 +1070,11 @@ general_operand (rtx op, machine_mode mode) int address_operand (rtx op, machine_mode mode) { + /* Wrong mode for an address expr. */ + if (GET_MODE (op) != VOIDmode + && ! SCALAR_INT_MODE_P (GET_MODE (op))) + return false; + return memory_address_p (mode, op); } @@ -2696,10 +2701,13 @@ constrain_operands (int strict, alternative_mask alternatives) /* p is used for address_operands. When we are called by gen_reload, no one will have checked that the address is strictly valid, i.e., that all pseudos requiring hard regs - have gotten them. */ - if (strict <= 0 - || (strict_memory_address_p (recog_data.operand_mode[opno], - op))) + have gotten them. We also want to make sure we have a + valid mode. */ + if ((GET_MODE (op) == VOIDmode + || SCALAR_INT_MODE_P (GET_MODE (op))) + && (strict <= 0 + || (strict_memory_address_p + (recog_data.operand_mode[opno], op)))) win = 1; break; |