aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index e040444..6e4f5c7 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4497,11 +4497,11 @@ count_type_elements (tree type)
tree telts = array_type_nelts (type);
if (telts && host_integerp (telts, 1))
{
- HOST_WIDE_INT n = tree_low_cst (telts, 1);
+ HOST_WIDE_INT n = tree_low_cst (telts, 1) + 1;
HOST_WIDE_INT m = count_type_elements (TREE_TYPE (type));
if (n == 0)
return 0;
- if (max / n < m)
+ else if (max / n > m)
return n * m;
}
return -1;