diff options
author | Richard Henderson <rth@cygnus.com> | 1999-10-14 18:52:29 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-10-14 18:52:29 -0700 |
commit | 556ffcc55247d9c77e0cca31a764dc56741da789 (patch) | |
tree | a2c9bf0ce2a7fd8466de760ea4c4fdc8aa203a22 /gcc | |
parent | 104140890ae1b03e68e58122aeb64177ac37f544 (diff) | |
download | gcc-556ffcc55247d9c77e0cca31a764dc56741da789.zip gcc-556ffcc55247d9c77e0cca31a764dc56741da789.tar.gz gcc-556ffcc55247d9c77e0cca31a764dc56741da789.tar.bz2 |
recog.c (pmode_register_operand): New.
* 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.
From-SVN: r29995
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/genrecog.c | 16 | ||||
-rw-r--r-- | gcc/print-rtl.c | 11 | ||||
-rw-r--r-- | gcc/recog.c | 10 | ||||
-rw-r--r-- | gcc/recog.h | 1 |
5 files changed, 40 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8eee31b..a796dd2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +Thu Oct 14 18:48:54 1999 Richard Henderson <rth@cygnus.com> + + * 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. + Thu Oct 14 19:38:42 1999 Jeffrey A Law (law@cygnus.com) Sylvian Pion <Sylvain.Pion@sophia.inria.fr> diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 6e1af3a..d12d7c6 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?", diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 1c503c1..8521b3c 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -299,16 +299,21 @@ print_rtx (in_rtx) case 'u': if (XEXP (in_rtx, i) != NULL) { - if (GET_CODE (XEXP (in_rtx, i)) != CODE_LABEL) + rtx sub = XEXP (in_rtx, i); + enum rtx_code subc = GET_CODE (sub); + + if (subc != CODE_LABEL + && subc != NOTE + && GET_RTX_CLASS (subc) != 'i') goto do_e; if (flag_dump_unnumbered) fputc ('#', outfile); else - fprintf (outfile, " %d", INSN_UID (XEXP (in_rtx, i))); + fprintf (outfile, " %d", INSN_UID (sub)); } else - fputs (" 0", outfile); + fputs (" (nil)", outfile); sawclose = 0; break; diff --git a/gcc/recog.c b/gcc/recog.c index 1d27730..3b50b83 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1027,6 +1027,16 @@ register_operand (op, mode) || REGNO_REG_CLASS (REGNO (op)) != NO_REGS)); } +/* Return 1 for a register in Pmode; ignore the tested mode. */ + +int +pmode_register_operand (op, mode) + rtx op; + enum machine_mode mode ATTRIBUTE_UNUSED; +{ + return register_operand (op, Pmode); +} + /* Return 1 if OP should match a MATCH_SCRATCH, i.e., if it is a SCRATCH or a hard register. */ diff --git a/gcc/recog.h b/gcc/recog.h index 0e26f25..b84758c 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -91,6 +91,7 @@ extern rtx *find_single_use PROTO((rtx, rtx, rtx *)); extern int general_operand PROTO((rtx, enum machine_mode)); extern int address_operand PROTO((rtx, enum machine_mode)); extern int register_operand PROTO((rtx, enum machine_mode)); +extern int pmode_register_operand PROTO((rtx, enum machine_mode)); extern int scratch_operand PROTO((rtx, enum machine_mode)); extern int immediate_operand PROTO((rtx, enum machine_mode)); extern int const_int_operand PROTO((rtx, enum machine_mode)); |