From: Martin Sebor Date: Sun, 22 Jul 2018 21:09:32 +0000 (+0000) Subject: PR bootstrap/86621 - 'alloca' bound is unknown in tree-vect-slp.c:1437:16 X-Git-Tag: basepoints/gcc-10~5192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef856020de21b5e66e0aaec2d2b186817ae2829b;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7be6b8d6c1dd..19fa73a2404b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-07-22 Martin Sebor + + PR bootstrap/86621 + * 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. + 2018-07-22 Gerald Pfeifer * doc/gcov.texi (Invoking Gcov): Editorial changes. diff --git a/gcc/gimple-ssa-warn-alloca.c b/gcc/gimple-ssa-warn-alloca.c index cc66c466217b..0331f66844a3 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.