tree-vect-data-refs.c (vect_check_gather_scatter): Fail for reverse storage order...
authorRichard Biener <rguenth@gcc.gnu.org>
Mon, 25 Jun 2018 11:01:07 +0000 (11:01 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 25 Jun 2018 11:01:07 +0000 (11:01 +0000)
2018-06-25  Richard Biener  <rguenther@suse.de>
        Eric Botcazou  <ebotcazou@libertysurf.fr>

* tree-vect-data-refs.c (vect_check_gather_scatter): Fail
for reverse storage order accesses rather than asserting
they cannot happen here.

* gnat.dg/sso9.adb: New testcase.
* gnat.dg/sso9_pkg.ads: Likewise.

From-SVN: r262007

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/sso9.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/sso9_pkg.ads [new file with mode: 0644]
gcc/tree-vect-data-refs.c

index f4df7442de43aafd7ccab88258fea31cf76fe260..b813bd8564fadbfef294abeaebdb723bfe33fe4e 100644 (file)
@@ -1,3 +1,9 @@
+2018-06-25  Richard Biener  <rguenther@suse.de>
+
+       * tree-vect-data-refs.c (vect_check_gather_scatter): Fail
+       for reverse storage order accesses rather than asserting
+       they cannot happen here.
+
 2018-06-25  Tom de Vries  <tdevries@suse.de>
 
        PR debug/86257
index e8ab480febf48d6e87c818c2484006e7901a5e99..c2da64239eb47d4271b8aa595cc69d25b93faa93 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gnat.dg/sso9.adb: New testcase.
+       * gnat.dg/sso9_pkg.ads: Likewise.
+
 2018-06-25  Tom de Vries  <tdevries@suse.de>
 
        PR debug/86257
diff --git a/gcc/testsuite/gnat.dg/sso9.adb b/gcc/testsuite/gnat.dg/sso9.adb
new file mode 100644 (file)
index 0000000..be35bdc
--- /dev/null
@@ -0,0 +1,10 @@
+-- { dg-do compile }
+-- { dg-options "-O3 -gnatws" }
+
+with SSO9_Pkg; use SSO9_Pkg;
+
+procedure SSO9 is
+   A : Arr;
+begin
+   Proc (A);
+end;
diff --git a/gcc/testsuite/gnat.dg/sso9_pkg.ads b/gcc/testsuite/gnat.dg/sso9_pkg.ads
new file mode 100644 (file)
index 0000000..d755897
--- /dev/null
@@ -0,0 +1,16 @@
+with System;
+
+package SSO9_Pkg is
+
+   type Rec (D : Boolean := False) is record
+      B : Boolean;
+   end record;
+
+   for Rec'Bit_Order use System.High_Order_First;
+   for Rec'Scalar_Storage_Order use System.High_Order_First;
+
+   type Arr is array (1 .. 16) of Rec;
+
+   procedure Proc (A : Arr);
+
+end SSO9_Pkg;
index 1ac37bf5001286f942a6df392ef17f67dcd46214..19ff78226b00769775db2fb2d733e3045cc34671 100644 (file)
@@ -3730,7 +3730,9 @@ vect_check_gather_scatter (gimple *stmt, loop_vec_info loop_vinfo,
      that can be gimplified before the loop.  */
   base = get_inner_reference (base, &pbitsize, &pbitpos, &off, &pmode,
                              &punsignedp, &reversep, &pvolatilep);
-  gcc_assert (base && !reversep);
+  if (reversep)
+    return false;
+
   poly_int64 pbytepos = exact_div (pbitpos, BITS_PER_UNIT);
 
   if (TREE_CODE (base) == MEM_REF)