aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-16 12:44:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-16 12:44:46 +0000
commit550918ca7dd62e7ac5e11cce696b73fa67227639 (patch)
tree6d0cf456ca1d23a6929bcb816d7d099e283934cd /gcc/omp-low.c
parente8e028cb1f56f5f7068b78ef8cab6e7ae8f211d7 (diff)
downloadgcc-550918ca7dd62e7ac5e11cce696b73fa67227639.zip
gcc-550918ca7dd62e7ac5e11cce696b73fa67227639.tar.gz
gcc-550918ca7dd62e7ac5e11cce696b73fa67227639.tar.bz2
re PR tree-optimization/39698 (wrong types for vectorized reduction)
2009-04-16 Richard Guenther <rguenther@suse.de> Ira Rosen <irar@il.ibm.com> PR tree-optimization/39698 * tree-vect-loop.c (get_initial_def_for_reduction): Use the type of the reduction variable. Only generate the def if it is needed. * omp-low.c (expand_omp_for_generic): When converting to a pointer make sure to first convert to an integer of the same precision. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Retain the type of the evolution correctly in computing the new induction variable base. Co-Authored-By: Ira Rosen <irar@il.ibm.com> From-SVN: r146180
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index c28bbb0..0fa938a 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3812,21 +3812,25 @@ expand_omp_for_generic (struct omp_region *region,
/* Iteration setup for sequential loop goes in L0_BB. */
gsi = gsi_start_bb (l0_bb);
+ t = istart0;
if (bias)
- t = fold_convert (type, fold_build2 (MINUS_EXPR, fd->iter_type,
- istart0, bias));
- else
- t = fold_convert (type, istart0);
+ t = fold_build2 (MINUS_EXPR, fd->iter_type, t, bias);
+ if (POINTER_TYPE_P (type))
+ t = fold_convert (lang_hooks.types.type_for_size (TYPE_PRECISION (type),
+ 0), t);
+ t = fold_convert (type, t);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
false, GSI_CONTINUE_LINKING);
stmt = gimple_build_assign (fd->loop.v, t);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
+ t = iend0;
if (bias)
- t = fold_convert (type, fold_build2 (MINUS_EXPR, fd->iter_type,
- iend0, bias));
- else
- t = fold_convert (type, iend0);
+ t = fold_build2 (MINUS_EXPR, fd->iter_type, t, bias);
+ if (POINTER_TYPE_P (type))
+ t = fold_convert (lang_hooks.types.type_for_size (TYPE_PRECISION (type),
+ 0), t);
+ t = fold_convert (type, t);
iend = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
if (fd->collapse > 1)