Commit 338f655d by Ira Rosen Committed by Ira Rosen

re PR tree-optimization/49771 (wrong code with -ftree-vectorize)


        PR tree-optimization/49771
        * tree-vect-loop-manip.c (vect_vfa_segment_size): In case of
        zero step, set segment length to the size of the data-ref's type.

From-SVN: r176434
parent 24d71c2b
2011-07-19 Ira Rosen <ira.rosen@linaro.org>
PR tree-optimization/49771
* tree-vect-loop-manip.c (vect_vfa_segment_size): In case of
zero step, set segment length to the size of the data-ref's type.
2011-07-18 Martin Jambor <mjambor@suse.cz> 2011-07-18 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h: Include alloc-pool.h, all sorts of updates to general * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general
......
2011-07-19 Ira Rosen <ira.rosen@linaro.org>
PR tree-optimization/49771
* gcc.dg/vect/pr49771.c: New test.
2011-07-18 Martin Jambor <mjambor@suse.cz> 2011-07-18 Martin Jambor <mjambor@suse.cz>
* gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * gcc.dg/ipa/ipa-1.c: Updated testcase dump scan.
......
#include <stdlib.h>
#include <stdarg.h>
static int a[1000];
int
foo (void)
{
int j;
int i;
for (i = 0; i < 1000; i++)
for (j = 0; j < 1000; j++)
a[j] = a[i] + 1;
return a[0];
}
int
main (void)
{
int res = foo ();
if (res != 1999)
abort ();
return 0;
}
/* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -2356,9 +2356,14 @@ static tree ...@@ -2356,9 +2356,14 @@ static tree
vect_vfa_segment_size (struct data_reference *dr, tree length_factor) vect_vfa_segment_size (struct data_reference *dr, tree length_factor)
{ {
tree segment_length; tree segment_length;
segment_length = size_binop (MULT_EXPR,
fold_convert (sizetype, DR_STEP (dr)), if (!compare_tree_int (DR_STEP (dr), 0))
fold_convert (sizetype, length_factor)); segment_length = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr)));
else
segment_length = size_binop (MULT_EXPR,
fold_convert (sizetype, DR_STEP (dr)),
fold_convert (sizetype, length_factor));
if (vect_supportable_dr_alignment (dr, false) if (vect_supportable_dr_alignment (dr, false)
== dr_explicit_realign_optimized) == dr_explicit_realign_optimized)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment