From f4c222c0358dc0f9f6390e1eee1c6a9214f7f829 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 7 Aug 2017 17:06:11 +0000 Subject: Fix diff_type in expand_oacc_for char iter_type 2017-08-07 Tom de Vries PR middle-end/78266 * omp-expand.c (expand_oacc_for): Ensure diff_type is large enough. * testsuite/libgomp.oacc-c-c++-common/vprop-2.c: New test. * testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove xfail. From-SVN: r250925 --- gcc/omp-expand.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/omp-expand.c') diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 0a0098a..0f63507 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -5328,6 +5328,8 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd) } if (POINTER_TYPE_P (diff_type) || TYPE_UNSIGNED (diff_type)) diff_type = signed_type_for (diff_type); + if (TYPE_PRECISION (diff_type) < TYPE_PRECISION (integer_type_node)) + diff_type = integer_type_node; basic_block entry_bb = region->entry; /* BB ending in OMP_FOR */ basic_block exit_bb = region->exit; /* BB ending in OMP_RETURN */ -- cgit v1.1