From: sje Date: Wed, 23 Jan 2019 22:43:42 +0000 (+0000) Subject: 2019-01-23 Bin Cheng X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6edd2cf07ca40169f1a810a5df6987002822c95c;p=thirdparty%2Fgcc.git 2019-01-23 Bin Cheng Steve Ellcey PR target/85711 * recog.c (address_operand): Return false on wrong mode for address. (constrain_operands): Check for mode with 'p' constraint. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268219 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5befc93d0ef9..094bee462297 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-01-23 Bin Cheng + Steve Ellcey + + PR target/85711 + * recog.c (address_operand): Return false on wrong mode for address. + (constrain_operands): Check for mode with 'p' constraint. + 2019-01-23 Uroš Bizjak PR target/88998 diff --git a/gcc/recog.c b/gcc/recog.c index d0c498fced28..a9f584bc0dc5 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;