aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2017-08-07 17:06:11 +0000
committerTom de Vries <vries@gcc.gnu.org>2017-08-07 17:06:11 +0000
commitf4c222c0358dc0f9f6390e1eee1c6a9214f7f829 (patch)
tree75adc4e765783e7a1a3ac4a08c86f29481880c7c /gcc
parent58fccd6c21433d60c8ff41272c2edec0d4f39df7 (diff)
downloadgcc-f4c222c0358dc0f9f6390e1eee1c6a9214f7f829.zip
gcc-f4c222c0358dc0f9f6390e1eee1c6a9214f7f829.tar.gz
gcc-f4c222c0358dc0f9f6390e1eee1c6a9214f7f829.tar.bz2
Fix diff_type in expand_oacc_for char iter_type
2017-08-07 Tom de Vries <tom@codesourcery.com> 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/omp-expand.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7579f41..2f1a274 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-08-07 Tom de Vries <tom@codesourcery.com>
+
+ PR middle-end/78266
+ * omp-expand.c (expand_oacc_for): Ensure diff_type is large enough.
+
2017-08-07 Martin Liska <mliska@suse.cz>
* config/mips/mips.c: Include attribs.h.
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 */