summaryrefslogtreecommitdiff
path: root/gcc/c/c-typeck.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-typeck.c')
-rw-r--r--gcc/c/c-typeck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index c2b08ab32ee..4119eec22fe 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -12087,9 +12087,9 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
&& TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
== INTEGER_CST)
{
- tree size = size_binop (PLUS_EXPR,
- TYPE_MAX_VALUE (TYPE_DOMAIN (type)),
- size_one_node);
+ tree size
+ = fold_convert (sizetype, TYPE_MAX_VALUE (TYPE_DOMAIN (type)));
+ size = size_binop (PLUS_EXPR, size, size_one_node);
if (TREE_CODE (low_bound) == INTEGER_CST)
{
if (tree_int_cst_lt (size, low_bound))