re PR rtl-optimization/70398 (gcc.dg/vect/slp-multitypes-9.c FAILs with -fno-tree...
authorVladimir Makarov <vmakarov@redhat.com>
Wed, 6 Apr 2016 16:48:36 +0000 (16:48 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Wed, 6 Apr 2016 16:48:36 +0000 (16:48 +0000)
2016-04-06  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/70398
* lra-constraints.c (process_address_1): Check zero scale and code
for reloading with zero scale.

2016-04-06  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/70398
* testsuite/gcc.target/aarch64/pr70398.c: New.

From-SVN: r234792

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

index 16633de2a080d54b464d77b76f8953d651b53282..ecbac2e7dc71361d40253eecfd0fcc86a263299b 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-06  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/70398
+       * lra-constraints.c (process_address_1): Check zero scale and code
+       for reloading with zero scale.
+
 2016-04-06  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/sse.md (shuffletype): Add V32HI and V4TI modes.
index 4883eefc53239b200895509088af3881435bd6a0..c00afe766cf0581204cae6d7ec5b51373b8ff179 100644 (file)
@@ -2914,6 +2914,7 @@ process_address_1 (int nop, bool check_only_p,
 {
   struct address_info ad;
   rtx new_reg;
+  HOST_WIDE_INT scale;
   rtx op = *curr_id->operand_loc[nop];
   const char *constraint = curr_static_id->operand[nop].constraint;
   enum constraint_num cn = lookup_constraint (constraint);
@@ -3161,14 +3162,14 @@ process_address_1 (int nop, bool check_only_p,
       *ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
                                       new_reg, *ad.index);
     }
-  else if (get_index_scale (&ad) == 1)
+  else if ((scale = get_index_scale (&ad)) == 1)
     {
       /* The last transformation to one reg will be made in
         curr_insn_transform function.  */
       end_sequence ();
       return false;
     }
-  else
+  else if (scale != 0)
     {
       /* base + scale * index => base + new_reg,
         case (1) above.
@@ -3180,6 +3181,17 @@ process_address_1 (int nop, bool check_only_p,
       *ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
                                       *ad.base_term, new_reg);
     }
+  else
+    {
+      enum reg_class cl = base_reg_class (ad.mode, ad.as,
+                                         SCRATCH, SCRATCH);
+      rtx addr = *ad.inner;
+      
+      new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "addr");
+      /* addr => new_base.  */
+      lra_emit_move (new_reg, addr);
+      *ad.inner = new_reg;
+    }
   *before = get_insns ();
   end_sequence ();
   return true;
index be3c82af35c89d5def1ebed63a48cbe64c1eb8d8..bc9eed1d2901353d4c826e3a5969d2f2aad268cf 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-06  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/70398
+       * testsuite/gcc.target/aarch64/pr70398.c: New.
+
 2016-04-06  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.c-torture/execute/20101011-1.c (__VISIUM__): Set DO_TEST to 0.
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70398.c b/gcc/testsuite/gcc.target/aarch64/pr70398.c
new file mode 100644 (file)
index 0000000..dbe5ad1
--- /dev/null
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O -fno-tree-loop-optimize -fno-tree-ter -static" } */
+unsigned int in[8 * 8] =
+  { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+    45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 };
+
+unsigned char out[8 * 8];
+
+int
+main (void)
+{
+  int i;
+  for (i = 0; i < 8 * 4; i++)
+    {
+      out[i * 2] = (unsigned char) in[i * 2] + 1;
+      out[i * 2 + 1] = (unsigned char) in[i * 2 + 1] + 2;
+    }
+  __asm__("":::"memory");
+  for (i = 0; i < 8 * 4; i++)
+    {
+      if (out[i * 2] != in[i * 2] + 1
+         || out[i * 2 + 1] != in[i * 2 + 1] + 2)
+       __builtin_abort ();
+    }
+  return 0;
+}