aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index e1b2848..6a2875e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4904,6 +4904,8 @@ check_read_access (tree exp, tree src, tree bound /* = NULL_TREE */,
if (!warn_stringop_overread)
return true;
+ if (bound && !useless_type_conversion_p (size_type_node, TREE_TYPE (bound)))
+ bound = fold_convert (size_type_node, bound);
access_data data (exp, access_read_only, NULL_TREE, false, bound, true);
compute_objsize (src, ost, &data.src);
return check_access (exp, /*dstwrite=*/ NULL_TREE, /*maxread=*/ bound,