re PR rtl-optimization/89676 (Redundant moves for long long shift on 32bit x86)
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 22 Mar 2019 16:59:21 +0000 (16:59 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 22 Mar 2019 16:59:21 +0000 (16:59 +0000)
2019-03-22  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/89676
* lra-constraints.c (curr_insn_transform): Do match reload for
early clobbers even if the match was successful.

2019-03-22  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/89676
* gcc.target/i386/pr89676.c: New.

From-SVN: r269878

gcc/ChangeLog
gcc/lra-constraints.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr89676.c [new file with mode: 0644]

index aa5530eb11f045062922b116ba4830835d9105d6..c10c4c745a5c7519671b445d5b62e20558d2e1b6 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-22  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/89676
+       * lra-constraints.c (curr_insn_transform): Do match reload for
+       early clobbers even if the match was successful.
+
 2019-03-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/87481
index cba87eb718e6e75321e11fc4870d5f97cc24167e..78932cc1538d8151372ca2d25e40ef1aad5fff88 100644 (file)
@@ -4256,6 +4256,20 @@ curr_insn_transform (bool check_only_p)
                           || MEM_P (SET_DEST (curr_insn_set))
                           || GET_CODE (SET_DEST (curr_insn_set)) == SUBREG))))
            optional_p = true;
+         else if (goal_alt_matched[i][0] != -1
+                  && curr_static_id->operand[i].type == OP_OUT
+                  && (curr_static_id->operand_alternative
+                      [goal_alt_number * n_operands + i].earlyclobber))
+           {
+             /* Generate reloads for output and matched inputs.  This
+                is the easiest way to avoid creation of non-existing
+                conflicts in lra-lives.c.  */
+             match_reload (i, goal_alt_matched[i], outputs, goal_alt[i], &before,
+                           &after, TRUE);
+             outputs[n_outputs++] = i;
+             outputs[n_outputs] = -1;
+             continue;
+           }
          else
            continue;
        }
index 8324702d242ac9cab625a30bb203e65a9569a0b3..5626696d166a48b4e0af2a6c27669c937874f687 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-22  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/89676
+       * gcc.target/i386/pr89676.c: New.
+
 2019-03-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/60702
diff --git a/gcc/testsuite/gcc.target/i386/pr89676.c b/gcc/testsuite/gcc.target/i386/pr89676.c
new file mode 100644 (file)
index 0000000..90865d8
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR rtl-optimization/89676 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -m32 -march=i686" } */
+unsigned long long
+foo (unsigned long long i)
+{
+  return i << 3;
+}
+
+/* { dg-final { scan-assembler-times "movl" 2 } } */