]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/96075 - fix bogus misalignment calculation
authorRichard Biener <rguenther@suse.de>
Mon, 6 Jul 2020 14:26:50 +0000 (16:26 +0200)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:16:19 +0000 (13:16 -0300)
commite3314f1999156fb684c3095103911c49991b9479
tree4684a4a700588171e8be543a482b5e4aa2539016
parent69ef8d4b4f29adcb654453793f0ff8126584fc47
tree-optimization/96075 - fix bogus misalignment calculation

This fixes bogus misalignment calculation for negative steps
since an assertion a previous comment indicated no longer holds:

      /* DR_STEP(dr) is the same as -TYPE_SIZE of the scalar type,
         otherwise we wouldn't be here.  */

Thus the following replaces DR_STEP by -TYPE_SIZE.

2020-07-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/96075
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Use
TYPE_SIZE_UNIT of the vector component type instead of DR_STEP
for the misalignment calculation for negative step.

* gcc.dg/vect/slp-46.c: New testcase.
gcc/testsuite/gcc.dg/vect/slp-46.c [new file with mode: 0644]
gcc/tree-vect-data-refs.c