re PR middle-end/59569 (r206148 causes internal compiler error: in vect_create_destin...
authorBingfeng Mei <bmei@broadcom.com>
Mon, 23 Dec 2013 15:07:58 +0000 (15:07 +0000)
committerBingfeng Mei <meibf@gcc.gnu.org>
Mon, 23 Dec 2013 15:07:58 +0000 (15:07 +0000)
2013-12-23  Bingfeng Mei  <bmei@broadcom.com>

PR middle-end/59569
* tree-vect-stmts.c (vectorizable_store): Skip permutation for
consant operand, and add a few missing \n.

* gcc.c-torture/compile/pr59569-1.c: New test.
* gcc.c-torture/compile/pr59569-2.c: Ditto.

From-SVN: r206179

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr59569-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr59569-2.c [new file with mode: 0644]
gcc/tree-vect-stmts.c

index 9a5b798..b9fe763 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-23  Bingfeng Mei  <bmei@broadcom.com>
+
+       PR middle-end/59569
+       * tree-vect-stmts.c (vectorizable_store): Skip permutation for
+       consant/external operand, and add a few missing \n.
+
 2013-12-23   H.J. Lu  <hongjiu.lu@intel.com>
             Tocar Ilya  <ilya.tocar@intel.com> 
 
index fbd5ba1..c4fad36 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-23  Bingfeng Mei  <bmei@broadcom.com>
+
+       PR middle-end/59569
+       * gcc.c-torture/compile/pr59569-1.c: New test.
+       * gcc.c-torture/compile/pr59569-2.c: Ditto.
+
 2013-12-23  Marek Polacek  <polacek@redhat.com>
 
        PR c++/59111
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr59569-1.c b/gcc/testsuite/gcc.c-torture/compile/pr59569-1.c
new file mode 100644 (file)
index 0000000..116c724
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR middle-end/59569 */
+extern char c;
+
+void
+foo (int i, char **j)
+{
+  while (i)
+    j[--i] = &c;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr59569-2.c b/gcc/testsuite/gcc.c-torture/compile/pr59569-2.c
new file mode 100644 (file)
index 0000000..e813b88
--- /dev/null
@@ -0,0 +1,6 @@
+/* PR middle-end/59569 */
+void foo (int *a, int b)
+{
+  for (; b; b--)
+    a[b] = 1;
+}
index 18cf563..e3009d9 100644 (file)
@@ -5005,7 +5005,7 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
     {
       if (dump_enabled_p ())
         dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                        "multiple types with negative step.");
+                        "multiple types with negative step.\n");
       return false;
     }
 
@@ -5018,14 +5018,16 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                            "negative step but alignment required.");
+                            "negative step but alignment required.\n");
          return false;
        }
-      if (!perm_mask_for_reverse (vectype))
+      if (dt != vect_constant_def 
+         && dt != vect_external_def
+         && !perm_mask_for_reverse (vectype))
        {
          if (dump_enabled_p ())
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-                            "negative step and reversing not supported.");
+                            "negative step and reversing not supported.\n");
          return false;
        }
     }
@@ -5353,7 +5355,9 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                set_ptr_info_alignment (get_ptr_info (dataref_ptr), align,
                                        misalign);
 
-             if (negative)
+             if (negative
+                 && dt != vect_constant_def 
+                 && dt != vect_external_def)
                {
                  tree perm_mask = perm_mask_for_reverse (vectype);
                  tree perm_dest