diff options
author | Richard Henderson <rth@redhat.com> | 2004-01-09 19:14:07 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-01-09 19:14:07 -0800 |
commit | 47069ecbe6cad05836dace19eefcfaf10cd10288 (patch) | |
tree | e2c83b04f6f5ebff19d926c3fbd6032168c06ea7 /gcc/recog.c | |
parent | c31d56ed0619b8fc21e00b92fe6abe6268bd8094 (diff) | |
download | gcc-47069ecbe6cad05836dace19eefcfaf10cd10288.zip gcc-47069ecbe6cad05836dace19eefcfaf10cd10288.tar.gz gcc-47069ecbe6cad05836dace19eefcfaf10cd10288.tar.bz2 |
* recog.c (constrain_operands): Validate mem operands.
From-SVN: r75624
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 9f5c152..d2338e6 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -2445,12 +2445,25 @@ constrain_operands (int strict) break; case 'm': - if (GET_CODE (op) == MEM - /* Before reload, accept what reload can turn into mem. */ - || (strict < 0 && CONSTANT_P (op)) - /* During reload, accept a pseudo */ - || (reload_in_progress && GET_CODE (op) == REG - && REGNO (op) >= FIRST_PSEUDO_REGISTER)) + /* Memory operands must be valid, to the extent + required by STRICT. */ + if (GET_CODE (op) == MEM) + { + if (strict > 0 + && !strict_memory_address_p (GET_MODE (op), + XEXP (op, 0))) + break; + if (strict == 0 + && !memory_address_p (GET_MODE (op), XEXP (op, 0))) + break; + win = 1; + } + /* Before reload, accept what reload can turn into mem. */ + else if (strict < 0 && CONSTANT_P (op)) + win = 1; + /* During reload, accept a pseudo */ + else if (reload_in_progress && GET_CODE (op) == REG + && REGNO (op) >= FIRST_PSEUDO_REGISTER) win = 1; break; |