diff options
author | Richard Henderson <rth@cygnus.com> | 1999-02-01 12:03:23 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-02-01 12:03:23 -0800 |
commit | 1afbe1c4e6d0d9a4b09d942892fe45114ada158c (patch) | |
tree | 4ad9c160c4fe69d4a35626cadecaf2682d7d73f3 /gcc/recog.c | |
parent | 5326f06d7f73eae07a3c8825873f7a2358dfa0e2 (diff) | |
download | gcc-1afbe1c4e6d0d9a4b09d942892fe45114ada158c.zip gcc-1afbe1c4e6d0d9a4b09d942892fe45114ada158c.tar.gz gcc-1afbe1c4e6d0d9a4b09d942892fe45114ada158c.tar.bz2 |
recog.c (check_asm_operands): Treat indeterminate operand ok results as success.
* recog.c (check_asm_operands): Treat indeterminate operand ok
results as success. Try harder to resolve a matching constraint.
* stmt.c (expand_asm_operands): Recognize when an output operand's
constraint does not allow memory. Treat indeterminate operand ok
results as failure. Try harder to resolve a matching constraint.
From-SVN: r24959
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index a0dafd5..c62929c 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -188,7 +188,9 @@ check_asm_operands (x) for (i = 0; i < noperands; i++) { const char *c = constraints[i]; - if (ISDIGIT ((unsigned char)c[0])) + if (c[0] == '%') + c++; + if (ISDIGIT ((unsigned char)c[0]) && c[1] == '\0') c = constraints[c[0] - '0']; if (! asm_operand_ok (operands[i], c)) @@ -1550,13 +1552,16 @@ decode_asm_operands (body, operands, operand_locs, constraints, modes) return template; } -/* Check if an asm_operand matches it's constraints. */ +/* Check if an asm_operand matches it's constraints. + Return > 0 if ok, = 0 if bad, < 0 if inconclusive. */ int asm_operand_ok (op, constraint) rtx op; const char *constraint; { + int result = 0; + /* Use constrain_operands after reload. */ if (reload_completed) abort (); @@ -1578,9 +1583,11 @@ asm_operand_ok (op, constraint) case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - /* Our caller is supposed to have given us the proper - matching constraint. */ - /* abort (); */ + /* For best results, our caller should have given us the + proper matching constraint, but we can't actually fail + the check if they didn't. Indicate that results are + inconclusive. */ + result = -1; break; case 'p': @@ -1600,15 +1607,24 @@ asm_operand_ok (op, constraint) break; case '<': + /* ??? Before flow, auto inc/dec insns are not supposed to exist, + excepting those that expand_call created. Further, on some + machines which do not have generalized auto inc/dec, an inc/dec + is not a memory_operand. + + Match any memory and hope things are resolved after reload. */ + if (GET_CODE (op) == MEM - && (GET_CODE (XEXP (op, 0)) == PRE_DEC + && (1 + || GET_CODE (XEXP (op, 0)) == PRE_DEC || GET_CODE (XEXP (op, 0)) == POST_DEC)) return 1; break; case '>': if (GET_CODE (op) == MEM - && (GET_CODE (XEXP (op, 0)) == PRE_INC + && (1 + || GET_CODE (XEXP (op, 0)) == PRE_INC || GET_CODE (XEXP (op, 0)) == POST_INC)) return 1; break; @@ -1745,7 +1761,7 @@ asm_operand_ok (op, constraint) } } - return 0; + return result; } /* Given an rtx *P, if it is a sum containing an integer constant term, |