diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-03-23 21:03:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-03-23 21:03:50 +0100 |
commit | fc6a2c5d9a9b1338ef477e90b4b5d06b438ba82f (patch) | |
tree | 4065a00f4a4d32daf23fd885008073d594fbeea7 /gcc/tree-chkp.c | |
parent | 9804b0fb044f4678eaedaaa00b46cbb934a7d270 (diff) | |
download | gcc-fc6a2c5d9a9b1338ef477e90b4b5d06b438ba82f.zip gcc-fc6a2c5d9a9b1338ef477e90b4b5d06b438ba82f.tar.gz gcc-fc6a2c5d9a9b1338ef477e90b4b5d06b438ba82f.tar.bz2 |
re PR target/65523 (ICE: in gimple_op, at gimple.h:2270 with -fcheck-pointer-bounds -mmpx)
PR target/65523
* tree-chkp.c (chkp_build_returned_bound): Ignore
ERF_RETURNS_ARG calls if they have fewer than needed arguments.
* gcc.target/i386/pr65523.c: New test.
From-SVN: r221606
Diffstat (limited to 'gcc/tree-chkp.c')
-rw-r--r-- | gcc/tree-chkp.c | 8 |
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++) |