aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chkp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-chkp.c')
-rw-r--r--gcc/tree-chkp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index d2df4ba..977c460 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -2153,6 +2153,7 @@ chkp_build_returned_bound (gcall *call)
tree bounds;
gimple stmt;
tree fndecl = gimple_call_fndecl (call);
+ unsigned int retflags;
/* To avoid fixing alloca expands in targets we handle
it separately. */
@@ -2196,12 +2197,11 @@ chkp_build_returned_bound (gcall *call)
}
/* Do not use retbnd when returned bounds are equal to some
of passed bounds. */
- else if (gimple_call_return_flags (call) & ERF_RETURNS_ARG)
+ else if (((retflags = gimple_call_return_flags (call)) & ERF_RETURNS_ARG)
+ && (retflags & ERF_RETURN_ARG_MASK) < gimple_call_num_args (call))
{
gimple_stmt_iterator iter = gsi_for_stmt (call);
- unsigned int retarg = 0, argno;
- if (gimple_call_return_flags (call) & ERF_RETURNS_ARG)
- retarg = gimple_call_return_flags (call) & ERF_RETURN_ARG_MASK;
+ unsigned int retarg = retflags & ERF_RETURN_ARG_MASK, argno;
if (gimple_call_with_bounds_p (call))
{
for (argno = 0; argno < gimple_call_num_args (call); argno++)