recog.c (pmode_register_operand): New.
authorRichard Henderson <rth@cygnus.com>
Fri, 15 Oct 1999 01:52:29 +0000 (18:52 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 15 Oct 1999 01:52:29 +0000 (18:52 -0700)
        * 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

gcc/ChangeLog
gcc/genrecog.c
gcc/print-rtl.c
gcc/recog.c
gcc/recog.h

index 8eee31bca42e775a0c4fa480dd51b858538337c6..a796dd260cb44369ac7a438061c87fc2f8a9b1be 100644 (file)
@@ -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>
 
index 6e1af3a287f5c1c0d61b679c21626cf2e9cb604c..d12d7c6ff7047de68b09fe8b2aeeb349b2e7681e 100644 (file)
@@ -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?",
index 1c503c103ea3a4ba3a59bafbc2947a6fc4986f47..8521b3c638141727e3daa078fc01a9513b759263 100644 (file)
@@ -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;
 
index 1d277304e2a65863204a871efe98bf4feef6c64d..3b50b83ab136b043174586218250653d3e420f7a 100644 (file)
@@ -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.  */
 
index 0e26f2547d75b6b47177c500919b56e542a7ad70..b84758cf0d6e357ca5fce7e6bb974f4f119f5ed3 100644 (file)
@@ -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));