re PR middle-end/78328 (wrong wording for unbounded alloc case in -Walloca-larger-than note)

PR middle-end/78328
	* gimple-ssa-warn-alloca.c (alloca_call_type): Handle
	VR_ANTI_RANGE.

From-SVN: r243174
This commit is contained in:
Aldy Hernandez 2016-12-02 12:20:42 +00:00 committed by Aldy Hernandez
parent efa68ffca9
commit cc9037a6e9
3 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-12-02 Aldy Hernandez <aldyh@redhat.com>
PR middle-end/78328
* gimple-ssa-warn-alloca.c (alloca_call_type): Handle
VR_ANTI_RANGE.
2016-12-02 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.c (s390_save_gprs_to_fprs): Fix RTL sharing

View File

@ -339,6 +339,8 @@ alloca_call_type (gimple *stmt, bool is_vla, tree *invalid_casted_type)
{
// Fall through.
}
else if (range_type == VR_ANTI_RANGE)
return alloca_type_and_limit (ALLOCA_UNBOUNDED);
else if (range_type != VR_VARYING)
return
alloca_type_and_limit (ALLOCA_BOUND_MAYBE_LARGE, max);

View File

@ -0,0 +1,11 @@
/* { dg-do compile } */
/* { dg-options "-Walloca-larger-than=128 -O2" } */
void f (void*);
void g (unsigned int n)
{
if (n == 7)
n = 11;
f (__builtin_alloca (n)); /* { dg-warning "unbounded use of 'alloca'" } */
}