summaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-30 01:40:48 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-30 01:40:48 +0000
commit76cfd4f918c98f1bafc475e61c0611aab29a84ae (patch)
treec85ad91a8707ad90462a57b45f9304237ec4d72f /gcc/recog.c
parent64b70d26ad7a49b6b0eaedafea75472807ba6ab4 (diff)
downloadgcc-76cfd4f918c98f1bafc475e61c0611aab29a84ae.tar.gz
Fix problem noticed by Dale Johannesen on the gcc list.
* recog.c (asm_operand_ok): Add missing break after case 'X'. Change if statements to else if statements in default case. (extract_constrain_insn_cached): Fix misspelling of constrain_operands in comment. (constrain_operands_cached): Likewise. (constrain_operands): Change if statements to else if statements in default case. * reload.c (find_reloads): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c62
1 files changed, 26 insertions, 36 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 02ae71d5d53..3c67bd85193 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1746,6 +1746,7 @@ asm_operand_ok (rtx op, const char *constraint)
case 'X':
result = 1;
+ break;
case 'g':
if (general_operand (op, VOIDmode))
@@ -1764,20 +1765,16 @@ asm_operand_ok (rtx op, const char *constraint)
result = 1;
}
#ifdef EXTRA_CONSTRAINT_STR
- if (EXTRA_CONSTRAINT_STR (op, c, constraint))
+ else if (EXTRA_CONSTRAINT_STR (op, c, constraint))
+ result = 1;
+ else if (EXTRA_MEMORY_CONSTRAINT (c, constraint)
+ /* Every memory operand can be reloaded to fit. */
+ && memory_operand (op, VOIDmode))
+ result = 1;
+ else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint)
+ /* Every address operand can be reloaded to fit. */
+ && address_operand (op, VOIDmode))
result = 1;
- if (EXTRA_MEMORY_CONSTRAINT (c, constraint))
- {
- /* Every memory operand can be reloaded to fit. */
- if (memory_operand (op, VOIDmode))
- result = 1;
- }
- if (EXTRA_ADDRESS_CONSTRAINT (c, constraint))
- {
- /* Every address operand can be reloaded to fit. */
- if (address_operand (op, VOIDmode))
- result = 1;
- }
#endif
break;
}
@@ -1970,7 +1967,7 @@ extract_insn_cached (rtx insn)
extract_insn (insn);
recog_data.insn = insn;
}
-/* Do cached extract_insn, constrain_operand and complain about failures.
+/* Do cached extract_insn, constrain_operands and complain about failures.
Used by insn_attrtab. */
void
extract_constrain_insn_cached (rtx insn)
@@ -1980,7 +1977,7 @@ extract_constrain_insn_cached (rtx insn)
&& !constrain_operands (reload_completed))
fatal_insn_not_found (insn);
}
-/* Do cached constrain_operand and complain about failures. */
+/* Do cached constrain_operands and complain about failures. */
int
constrain_operands_cached (int strict)
{
@@ -2535,27 +2532,20 @@ constrain_operands (int strict)
else if (EXTRA_CONSTRAINT_STR (op, c, p))
win = 1;
- if (EXTRA_MEMORY_CONSTRAINT (c, p))
- {
- /* Every memory operand can be reloaded to fit. */
- if (strict < 0 && GET_CODE (op) == MEM)
- win = 1;
-
- /* Before reload, accept what reload can turn into mem. */
- if (strict < 0 && CONSTANT_P (op))
- win = 1;
-
- /* During reload, accept a pseudo */
- if (reload_in_progress && GET_CODE (op) == REG
- && REGNO (op) >= FIRST_PSEUDO_REGISTER)
- win = 1;
- }
- if (EXTRA_ADDRESS_CONSTRAINT (c, p))
- {
- /* Every address operand can be reloaded to fit. */
- if (strict < 0)
- win = 1;
- }
+ else if (EXTRA_MEMORY_CONSTRAINT (c, p)
+ /* Every memory operand can be reloaded to fit. */
+ && ((strict < 0 && 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)))
+ win = 1;
+ else if (EXTRA_ADDRESS_CONSTRAINT (c, p)
+ /* Every address operand can be reloaded to fit. */
+ && strict < 0)
+ win = 1;
#endif
break;
}