diff options
author | Martin Sebor <msebor@redhat.com> | 2018-07-22 21:09:32 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2018-07-22 15:09:32 -0600 |
commit | ef856020de21b5e66e0aaec2d2b186817ae2829b (patch) | |
tree | c30e4b3d1d65d193e3432c13c1508590e69fe930 /gcc/gimple-ssa-warn-alloca.c | |
parent | 5037f87ef92dd486ef768203db71f2b03d5834b2 (diff) | |
download | gcc-ef856020de21b5e66e0aaec2d2b186817ae2829b.zip gcc-ef856020de21b5e66e0aaec2d2b186817ae2829b.tar.gz gcc-ef856020de21b5e66e0aaec2d2b186817ae2829b.tar.bz2 |
PR bootstrap/86621 - 'alloca' bound is unknown in tree-vect-slp.c:1437:16
gcc/ChangeLog:
* gcc/gimple-ssa-warn-alloca.c (alloca_call_type_by_arg): Avoid
diagnosing calls with unknown arguments unless -Walloca-larger-than
is restricted to less than PTRDIFF_MAX bytes.
From-SVN: r262923
Diffstat (limited to 'gcc/gimple-ssa-warn-alloca.c')
-rw-r--r-- | gcc/gimple-ssa-warn-alloca.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-warn-alloca.c b/gcc/gimple-ssa-warn-alloca.c index cc66c46..0331f66 100644 --- a/gcc/gimple-ssa-warn-alloca.c +++ b/gcc/gimple-ssa-warn-alloca.c @@ -214,7 +214,15 @@ alloca_call_type_by_arg (tree arg, tree arg_casted, edge e, } } else - return alloca_type_and_limit (ALLOCA_BOUND_UNKNOWN); + { + /* Analogous to ALLOCA_UNBOUNDED, when MAX_SIZE is greater + than or equal to PTRDIFF_MAX, treat allocations with + an unknown bound as OK. */ + alloca_type unknown_result + = (max_size < maxobjsize.to_uhwi () + ? ALLOCA_BOUND_UNKNOWN : ALLOCA_OK); + return alloca_type_and_limit (unknown_result); + } } // Similarly, but check for a comparison with an unknown LIMIT. |