From: Richard Biener Date: Mon, 25 Jun 2018 11:01:07 +0000 (+0000) Subject: tree-vect-data-refs.c (vect_check_gather_scatter): Fail for reverse storage order... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c9632905d39afc3c431d0ff4d318d15c9250344;p=gcc.git tree-vect-data-refs.c (vect_check_gather_scatter): Fail for reverse storage order accesses rather than asserting they cannot... 2018-06-25 Richard Biener Eric Botcazou * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f4df7442de4..b813bd8564f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-06-25 Richard Biener + + * 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 PR debug/86257 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e8ab480febf..c2da64239eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-25 Eric Botcazou + + * gnat.dg/sso9.adb: New testcase. + * gnat.dg/sso9_pkg.ads: Likewise. + 2018-06-25 Tom de Vries PR debug/86257 diff --git a/gcc/testsuite/gnat.dg/sso9.adb b/gcc/testsuite/gnat.dg/sso9.adb new file mode 100644 index 00000000000..be35bdcc666 --- /dev/null +++ b/gcc/testsuite/gnat.dg/sso9.adb @@ -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 index 00000000000..d7558973bd9 --- /dev/null +++ b/gcc/testsuite/gnat.dg/sso9_pkg.ads @@ -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; diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 1ac37bf5001..19ff78226b0 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -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)