re PR tree-optimization/69719 (wrong code at -O3 on x86_64-linux-gnu)
2016-02-08 Richard Biener <rguenther@suse.de> PR tree-optimization/69719 * tree-vect-data-refs.c (vect_prune_runtime_alias_test_list): Properly use absolute of the difference of the two offsets to compare or adjust the segment length. * gcc.dg/torture/pr69719.c: New testcase. From-SVN: r233212
This commit is contained in:
parent
63998a6336
commit
5317b1be7e
4 changed files with 45 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
|||
2016-02-08 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/69719
|
||||
* tree-vect-data-refs.c (vect_prune_runtime_alias_test_list):
|
||||
Properly use absolute of the difference of the two offsets to
|
||||
compare or adjust the segment length.
|
||||
|
||||
2016-02-08 Richard Biener <rguenther@suse.de>
|
||||
Jeff Law <law@redhat.com>
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2016-02-08 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/69719
|
||||
* gcc.dg/torture/pr69719.c: New testcase.
|
||||
|
||||
2016-02-08 Richard Biener <rguenther@suse.de>
|
||||
Jeff Law <law@redhat.com>
|
||||
|
||||
|
|
24
gcc/testsuite/gcc.dg/torture/pr69719.c
Normal file
24
gcc/testsuite/gcc.dg/torture/pr69719.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* { dg-do run } */
|
||||
|
||||
int b, c = 1, e, f;
|
||||
int a[6][5] = { {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, 0} };
|
||||
|
||||
void __attribute__((noinline))
|
||||
fn1 ()
|
||||
{
|
||||
int d;
|
||||
for (b = 0; b < 5; b++)
|
||||
for (d = 4; d; d--)
|
||||
a[c + 1][b] = a[d + 1][d];
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
fn1 ();
|
||||
|
||||
if (a[2][1] != 0)
|
||||
__builtin_abort ();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -3081,8 +3081,9 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
|
|||
|| !tree_fits_shwi_p (dr_a2->offset))
|
||||
continue;
|
||||
|
||||
HOST_WIDE_INT diff = (tree_to_shwi (dr_a2->offset)
|
||||
- tree_to_shwi (dr_a1->offset));
|
||||
unsigned HOST_WIDE_INT diff
|
||||
= absu_hwi (tree_to_shwi (dr_a2->offset)
|
||||
- tree_to_shwi (dr_a1->offset));
|
||||
|
||||
|
||||
/* Now we check if the following condition is satisfied:
|
||||
|
@ -3101,13 +3102,14 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
|
|||
|
||||
*/
|
||||
|
||||
HOST_WIDE_INT min_seg_len_b = (tree_fits_shwi_p (dr_b1->seg_len)
|
||||
? tree_to_shwi (dr_b1->seg_len)
|
||||
: vect_factor);
|
||||
unsigned HOST_WIDE_INT min_seg_len_b
|
||||
= (tree_fits_uhwi_p (dr_b1->seg_len)
|
||||
? tree_to_uhwi (dr_b1->seg_len)
|
||||
: vect_factor);
|
||||
|
||||
if (diff <= min_seg_len_b
|
||||
|| (tree_fits_shwi_p (dr_a1->seg_len)
|
||||
&& diff - tree_to_shwi (dr_a1->seg_len) < min_seg_len_b))
|
||||
|| (tree_fits_uhwi_p (dr_a1->seg_len)
|
||||
&& diff - tree_to_uhwi (dr_a1->seg_len) < min_seg_len_b))
|
||||
{
|
||||
if (dump_enabled_p ())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue