diff options
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
-rw-r--r-- | gcc/tree-ssa-loop-prefetch.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c index 633dd33..d63ede1 100644 --- a/gcc/tree-ssa-loop-prefetch.c +++ b/gcc/tree-ssa-loop-prefetch.c @@ -423,25 +423,24 @@ idx_analyze_ref (tree base, tree *index, void *data) ibase = build_int_cst (TREE_TYPE (ibase), 0); } - if (*ar_data->step == NULL_TREE) - *ar_data->step = step; - else - *ar_data->step = fold_build2 (PLUS_EXPR, sizetype, - fold_convert (sizetype, *ar_data->step), - fold_convert (sizetype, step)); if (TREE_CODE (base) == ARRAY_REF) { stepsize = array_ref_element_size (base); if (!cst_and_fits_in_hwi (stepsize)) return false; imult = int_cst_value (stepsize); - - *ar_data->step = fold_build2 (MULT_EXPR, sizetype, - fold_convert (sizetype, *ar_data->step), - fold_convert (sizetype, step)); + step = fold_build2 (MULT_EXPR, sizetype, + fold_convert (sizetype, step), + fold_convert (sizetype, stepsize)); idelta *= imult; } + if (*ar_data->step == NULL_TREE) + *ar_data->step = step; + else + *ar_data->step = fold_build2 (PLUS_EXPR, sizetype, + fold_convert (sizetype, *ar_data->step), + fold_convert (sizetype, step)); *ar_data->delta += idelta; *index = ibase; |