]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/64110 (ICE: Max. number of generated reload insns per insn...
authorVladimir Makarov <vmakarov@redhat.com>
Thu, 15 Jan 2015 20:26:19 +0000 (20:26 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Thu, 15 Jan 2015 20:26:19 +0000 (20:26 +0000)
2015-01-15  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/64110
* stmt.c (parse_output_constraint): Process '^' and '$'.
(parse_input_constraint): Ditto.
* lra-constraints.c (process_alt_operands): Process the new
constraints.
* ira-costs.c (record_reg_classes): Process the new constraint
'^'.
* genoutput.c (indep_constraints): Add '^' and '$'.
* config/i386/sse.md (*vec_dup<mode>): Use '$' instead of '!'.
* doc/md.texi: Add description of the new constraints.

2015-01-15  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/64110
* gcc.target/i386/pr64110.c: Add scan-assembler.

From-SVN: r219683

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/doc/md.texi
gcc/genoutput.c
gcc/ira-costs.c
gcc/lra-constraints.c
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr64110.c

index 3a27df9923fd597e09847f4604cbe1a97a64ef4d..dace3d91fbf41a190b14203a66d2fb715ceb9ef9 100644 (file)
@@ -1,3 +1,16 @@
+2015-01-15  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/64110
+       * stmt.c (parse_output_constraint): Process '^' and '$'.
+       (parse_input_constraint): Ditto.
+       * lra-constraints.c (process_alt_operands): Process the new
+       constraints.
+       * ira-costs.c (record_reg_classes): Process the new constraint
+       '^'.
+       * genoutput.c (indep_constraints): Add '^' and '$'.
+       * config/i386/sse.md (*vec_dup<mode>): Use '$' instead of '!'.
+       * doc/md.texi: Add description of the new constraints.
+
 2015-01-15  Thomas Schwinge  <thomas@codesourcery.com>
            Bernd Schmidt  <bernds@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>
index cd4af4e09ac8cd9cb8201a55771d18a8b6f390e6..41de832ebba86e9297e3f7e48af99824b4c775ce 100644 (file)
 (define_insn "*vec_dup<mode>"
   [(set (match_operand:AVX2_VEC_DUP_MODE 0 "register_operand" "=x,x,x")
        (vec_duplicate:AVX2_VEC_DUP_MODE
-         (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "m,x,!r")))]
+         (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "m,x,$r")))]
   "TARGET_AVX2"
   "@
    v<sseintprefix>broadcast<bcstscalarsuff>\t{%1, %0|%0, %1}
index 461ddf18d8b50aaa35095a160540480b64c70d07..7bc78422d5bfc9d07560c21e7e67eda0bb52c042 100644 (file)
@@ -1507,6 +1507,18 @@ in it.
 Disparage severely the alternative that the @samp{!} appears in.
 This alternative can still be used if it fits without reloading,
 but if reloading is needed, some other alternative will be used.
+
+@cindex @samp{^} in constraint
+@cindex caret
+@item ^
+This constraint is analogous to @samp{?} but it disparages slightly
+the alternative only if the operand with the @samp{?} needs a reload.
+
+@cindex @samp{$} in constraint
+@cindex dollar sign
+@item $
+This constraint is analogous to @samp{!} but it disparages severely
+the alternative only if the operand with the @samp{$} needs a reload.
 @end table
 
 @ifset INTERNALS
index 3be3e13fbead88e608779653bb4957855a5ebd3c..2144b8e038102381b40c14806779b9c229103b57 100644 (file)
@@ -209,7 +209,7 @@ struct constraint_data
 
 /* All machine-independent constraint characters (except digits) that
    are handled outside the define*_constraint mechanism.  */
-static const char indep_constraints[] = ",=+%*?!#&g";
+static const char indep_constraints[] = ",=+%*?!^$#&g";
 
 static struct constraint_data *
 constraints_by_letter_table[1 << CHAR_BIT];
index 0acb949d905c39c3af18d370da88b4ce6e7c8049..c19f2586affb562101b41b0c9a0cf5fd4681c647 100644 (file)
@@ -778,6 +778,10 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
                  c = *++p;
                  break;
 
+               case '^':
+                 alt_cost += 2;
+                 break;
+
                case '?':
                  alt_cost += 2;
                  break;
index cdfa94441e04799322684ae31dc4d81d8df6f994..f102fe5010fab474d2a7736e721d9f4802ee003a 100644 (file)
@@ -1657,6 +1657,7 @@ process_alt_operands (int only_alternative)
      then REJECT is ignored, but otherwise it gets this much counted
      against it in addition to the reloading needed.  */
   int reject;
+  int op_reject;
   /* The number of elements in the following array.  */
   int early_clobbered_regs_num;
   /* Numbers of operands which are early clobber registers.  */
@@ -1806,6 +1807,7 @@ process_alt_operands (int only_alternative)
             track.  */
          lra_assert (*p != 0 && *p != ',');
 
+         op_reject = 0;
          /* Scan this alternative's specs for this operand; set WIN
             if the operand fits any letter in this alternative.
             Otherwise, clear BADOP if this operand could fit some
@@ -1828,6 +1830,13 @@ process_alt_operands (int only_alternative)
                  early_clobber_p = true;
                  break;
 
+               case '$':
+                 op_reject += LRA_MAX_REJECT;
+                 break;
+               case '^':
+                 op_reject += LRA_LOSER_COST_FACTOR;
+                 break;
+
                case '#':
                  /* Ignore rest of this alternative.  */
                  c = '\0';
@@ -2114,6 +2123,7 @@ process_alt_operands (int only_alternative)
              int const_to_mem = 0;
              bool no_regs_p;
 
+             reject += op_reject;
              /* Never do output reload of stack pointer.  It makes
                 impossible to do elimination when SP is changed in
                 RTL.  */
index d1333adbb9977e23e95120b8a7d75fbb0ea6c5cf..b85e3e605dd00025ad49a2a614df7d51f2686c00 100644 (file)
@@ -307,6 +307,7 @@ parse_output_constraint (const char **constraint_p, int operand_num,
        break;
 
       case '?':  case '!':  case '*':  case '&':  case '#':
+      case '$':  case '^':
       case 'E':  case 'F':  case 'G':  case 'H':
       case 's':  case 'i':  case 'n':
       case 'I':  case 'J':  case 'K':  case 'L':  case 'M':
@@ -397,6 +398,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
 
       case '<':  case '>':
       case '?':  case '!':  case '*':  case '#':
+      case '$':  case '^':
       case 'E':  case 'F':  case 'G':  case 'H':
       case 's':  case 'i':  case 'n':
       case 'I':  case 'J':  case 'K':  case 'L':  case 'M':
index 885a710173706e32c1aa7e38a86e44eb5f5c5b9f..b59a8f49d1eae07199708812f036ad27d759e7b0 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-15  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/64110
+       * gcc.target/i386/pr64110.c: Add scan-assembler.
+
 2015-01-15  Thomas Schwinge  <thomas@codesourcery.com>
            James Norris  <jnorris@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>
index 84d884374cdc85003ecd00e48b1edfc138d27e88..99e391916cb7a94e7dd40207f35f29f62acc412c 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -march=core-avx2" } */
+/* { dg-final { scan-assembler "vmovd\[\\t \]" } } */
 
 int foo (void);
 int a;