]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
recog.h (extract_constrain_insn): Declare.
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 22 Oct 2014 12:01:59 +0000 (12:01 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 22 Oct 2014 12:01:59 +0000 (12:01 +0000)
gcc/
* recog.h (extract_constrain_insn): Declare.
* recog.c (extract_constrain_insn): New function.
* lra.c (check_rtl): Use it.
* postreload.c (reload_cse_simplify_operands): Likewise.
* reg-stack.c (check_asm_stack_operands): Likewise.
(subst_asm_stack_regs): Likewise.
* regcprop.c (copyprop_hardreg_forward_1): Likewise.
* regrename.c (build_def_use): Likewise.
* sel-sched.c (get_reg_class): Likewise.
* config/arm/arm.c (note_invalid_constants): Likewise.
* config/s390/predicates.md (execute_operation): Likewise.

From-SVN: r216553

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/s390/predicates.md
gcc/lra.c
gcc/postreload.c
gcc/recog.c
gcc/recog.h
gcc/reg-stack.c
gcc/regcprop.c
gcc/regrename.c
gcc/sel-sched.c

index f944f7654911b5c776477007a2865b11fa7f98ea..5de3d9f58b1dba6fe395102c6a57def2f0e553d2 100644 (file)
@@ -1,3 +1,17 @@
+2014-10-22  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * recog.h (extract_constrain_insn): Declare.
+       * recog.c (extract_constrain_insn): New function.
+       * lra.c (check_rtl): Use it.
+       * postreload.c (reload_cse_simplify_operands): Likewise.
+       * reg-stack.c (check_asm_stack_operands): Likewise.
+       (subst_asm_stack_regs): Likewise.
+       * regcprop.c (copyprop_hardreg_forward_1): Likewise.
+       * regrename.c (build_def_use): Likewise.
+       * sel-sched.c (get_reg_class): Likewise.
+       * config/arm/arm.c (note_invalid_constants): Likewise.
+       * config/s390/predicates.md (execute_operation): Likewise.
+
 2014-10-22  Jakub Jelinek  <jakub@redhat.com>
            Yury Gribov  <y.gribov@samsung.com>
 
index 1ee0eb355c3ae94335325867e7d47f5478a45a40..40473d006608eb0b241c42b50a3938d95709e5e6 100644 (file)
@@ -17027,10 +17027,7 @@ note_invalid_constants (rtx_insn *insn, HOST_WIDE_INT address, int do_pushes)
 {
   int opno;
 
-  extract_insn (insn);
-
-  if (!constrain_operands (1))
-    fatal_insn_not_found (insn);
+  extract_constrain_insn (insn);
 
   if (recog_data.n_alternatives == 0)
     return;
index 883d5cc2d62bd454a81ea53b7850c3c3bbfbc50e..237cfa77533d514985b0a97fe85f848a80248be0 100644 (file)
   if (icode < 0)
     return false;
 
-  extract_insn (insn);
-  constrain_operands (1);
+  extract_constrain_insn (insn);
 
   return which_alternative >= 0;
 })
index 6fb35a13fac7f126824a95be22b991e0a69bf4f0..6326131d8c36573d00b9109003819d4628f6874b 100644 (file)
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -1923,8 +1923,9 @@ check_rtl (bool final_p)
       {
        if (final_p)
          {
-           extract_insn (insn);
-           lra_assert (constrain_operands (1));
+#ifdef ENABLED_CHECKING
+           extract_constrain_insn (insn);
+#endif
            continue;
          }
        /* LRA code is based on assumption that all addresses can be
index c9bb4ae3a3529859996a33e91fa7dc69629e660b..f460bf3a3a4a5279f8fc031be026bcbd09bf6f38 100644 (file)
@@ -405,15 +405,11 @@ reload_cse_simplify_operands (rtx_insn *insn, rtx testreg)
   /* Array of alternatives, sorted in order of decreasing desirability.  */
   int *alternative_order;
 
-  extract_insn (insn);
+  extract_constrain_insn (insn);
 
   if (recog_data.n_alternatives == 0 || recog_data.n_operands == 0)
     return 0;
 
-  /* Figure out which alternative currently matches.  */
-  if (! constrain_operands (1))
-    fatal_insn_not_found (insn);
-
   alternative_reject = XALLOCAVEC (int, recog_data.n_alternatives);
   alternative_nregs = XALLOCAVEC (int, recog_data.n_alternatives);
   alternative_order = XALLOCAVEC (int, recog_data.n_alternatives);
index 35cd22c56f7b96d1d80dca8d08b0d5b5dfbd8731..199c7debbf8343b16a0088381fc3a28854a7837d 100644 (file)
@@ -2115,6 +2115,17 @@ extract_insn_cached (rtx_insn *insn)
   recog_data.insn = insn;
 }
 
+/* Do uncached extract_insn, constrain_operands and complain about failures.
+   This should be used when extracting a pre-existing constrained instruction
+   if the caller wants to know which alternative was chosen.  */
+void
+extract_constrain_insn (rtx_insn *insn)
+{
+  extract_insn (insn);
+  if (!constrain_operands (reload_completed))
+    fatal_insn_not_found (insn);
+}
+
 /* Do cached extract_insn, constrain_operands and complain about failures.
    Used by insn_attrtab.  */
 void
index df974a915790d4e4c16cb07e9baeb5f1d403118d..d3619cbbe5a531fe99182adbccce7cfd71d4f8d3 100644 (file)
@@ -134,6 +134,7 @@ extern void add_clobbers (rtx, int);
 extern int added_clobbers_hard_reg_p (int);
 extern void insn_extract (rtx_insn *);
 extern void extract_insn (rtx_insn *);
+extern void extract_constrain_insn (rtx_insn *insn);
 extern void extract_constrain_insn_cached (rtx_insn *);
 extern void extract_insn_cached (rtx_insn *);
 extern void preprocess_constraints (int, int, const char **,
index 644ab71e867d9fd6da086e1c0095c6ef68eb0d86..88327ece0a189a1b551622079a10100e9b0091f3 100644 (file)
@@ -474,8 +474,7 @@ check_asm_stack_operands (rtx_insn *insn)
 
   /* Find out what the constraints require.  If no constraint
      alternative matches, this asm is malformed.  */
-  extract_insn (insn);
-  constrain_operands (1);
+  extract_constrain_insn (insn);
 
   preprocess_constraints (insn);
 
@@ -2021,8 +2020,7 @@ subst_asm_stack_regs (rtx_insn *insn, stack_ptr regstack)
   /* Find out what the constraints required.  If no constraint
      alternative matches, that is a compiler bug: we should have caught
      such an insn in check_asm_stack_operands.  */
-  extract_insn (insn);
-  constrain_operands (1);
+  extract_constrain_insn (insn);
 
   preprocess_constraints (insn);
   const operand_alternative *op_alt = which_op_alt ();
index 262de1be046ff971f892941d2d533cb279f99a43..e935a3572040cb7db127a9ab6582457e227e2bdc 100644 (file)
@@ -767,9 +767,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
        }
 
       set = single_set (insn);
-      extract_insn (insn);
-      if (! constrain_operands (1))
-       fatal_insn_not_found (insn);
+      extract_constrain_insn (insn);
       preprocess_constraints (insn);
       const operand_alternative *op_alt = which_op_alt ();
       n_ops = recog_data.n_operands;
@@ -870,9 +868,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
                }
              /* We need to re-extract as validate_change clobbers
                 recog_data.  */
-             extract_insn (insn);
-             if (! constrain_operands (1))
-               fatal_insn_not_found (insn);
+             extract_constrain_insn (insn);
              preprocess_constraints (insn);
            }
 
@@ -898,9 +894,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
                    }
                  /* We need to re-extract as validate_change clobbers
                     recog_data.  */
-                 extract_insn (insn);
-                 if (! constrain_operands (1))
-                   fatal_insn_not_found (insn);
+                 extract_constrain_insn (insn);
                  preprocess_constraints (insn);
                }
            }
index 7b9ca45fd1b4a82346ee9ad4d852949c6a896836..26bc8606b276a408eda1db67fcf369a59bb0b11c 100644 (file)
@@ -1569,9 +1569,7 @@ build_def_use (basic_block bb)
             to be marked unrenamable or even cause us to abort the entire
             basic block.  */
 
-         extract_insn (insn);
-         if (! constrain_operands (1))
-           fatal_insn_not_found (insn);
+         extract_constrain_insn (insn);
          preprocess_constraints (insn);
          const operand_alternative *op_alt = which_op_alt ();
          n_ops = recog_data.n_operands;
index 9b2be73327982211b2133b6bbee447f53953eae3..377e1e9b5f6ed7e71d576768096a3b4f950b76cd 100644 (file)
@@ -998,9 +998,7 @@ get_reg_class (rtx_insn *insn)
 {
   int i, n_ops;
 
-  extract_insn (insn);
-  if (! constrain_operands (1))
-    fatal_insn_not_found (insn);
+  extract_constrain_insn (insn);
   preprocess_constraints (insn);
   n_ops = recog_data.n_operands;