summaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-15 01:52:29 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-15 01:52:29 +0000
commit67b87c977ed8712253304c0026ceaacdbbe1956b (patch)
treea2c9bf0ce2a7fd8466de760ea4c4fdc8aa203a22 /gcc/genrecog.c
parent88b41b1070d21bc3287c52874e79964d7e46a6cc (diff)
downloadgcc-67b87c977ed8712253304c0026ceaacdbbe1956b.tar.gz
* recog.c (pmode_register_operand): New.
* recog.h: Declare it. * genrecog.c (pred_codes): Likewise. (special_mode_pred_table): Likewise. (validate_pattern): Don't warn no mode for address_operand. * print-rtl.c (print_rtx) [LABEL_REF]: Only do full subexpression if the operand is not insn-like. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29995 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 6e1af3a287f..d12d7c6ff70 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -197,6 +197,7 @@ static struct pred_table
{"address_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF, SUBREG, REG, MEM, PLUS, MINUS, MULT}},
{"register_operand", {SUBREG, REG}},
+ {"pmode_register_operand", {SUBREG, REG}},
{"scratch_operand", {SCRATCH, REG}},
{"immediate_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF,
LABEL_REF}},
@@ -220,11 +221,11 @@ static const char * special_mode_pred_table[] = {
#ifdef SPECIAL_MODE_PREDICATES
SPECIAL_MODE_PREDICATES
#endif
- NULL
+ "pmode_register_operand"
};
#define NUM_SPECIAL_MODE_PREDS \
- (sizeof (special_mode_pred_table) / sizeof (const char *) - 1)
+ (sizeof (special_mode_pred_table) / sizeof (special_mode_pred_table[0]))
static struct decision *new_decision
PROTO((const char *, struct decision_head *));
@@ -516,15 +517,18 @@ validate_pattern (pattern, insn, set_dest)
/* A modeless MATCH_OPERAND can be handy when we can
check for multiple modes in the c_test. In most other cases,
it is a mistake. Only DEFINE_INSN is eligible, since SPLIT
- and PEEP2 can FAIL within the output pattern. */
+ and PEEP2 can FAIL within the output pattern. Exclude
+ address_operand, since its mode is related to the mode of
+ the memory not the operand. */
if (GET_MODE (pattern) == VOIDmode
&& code == MATCH_OPERAND
- && pred_name[0] != '\0'
+ && GET_CODE (insn) == DEFINE_INSN
&& allows_non_const
&& ! special_mode_pred
- && strstr (c_test, "operands") == NULL
- && GET_CODE (insn) == DEFINE_INSN)
+ && pred_name[0] != '\0'
+ && strcmp (pred_name, "address_operand") != 0
+ && strstr (c_test, "operands") == NULL)
{
message_with_line (pattern_lineno,
"warning: operand %d missing mode?",