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
+2018-07-22 Martin Sebor <msebor@redhat.com>
+
+ 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 <gerald@pfeifer.com>
* doc/gcov.texi (Invoking Gcov): Editorial changes.
}
}
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.