1 /* { dg-do compile } */
2 /* { dg-options "-Walloca-larger-than=2000 -O2" } */
10 if (n
> 0 && n
< 2000)
11 // FIXME: This is a bogus warning, and is currently happening on
12 // 32-bit targets because VRP is not giving us any range info for
13 // the argument to __builtin_alloca. This should be fixed by the
14 // upcoming range work.
15 p
= __builtin_alloca (n
); // { dg-bogus "unbounded use of 'alloca'" "" { xfail { ! lp64 } } }
17 p
= __builtin_malloc (n
);
26 p
= __builtin_alloca (n
); // { dg-warning "large due to conversion" }
28 p
= __builtin_malloc (n
);
36 if (n
> 0 && n
< 3000)
38 p
= __builtin_alloca (n
); // { dg-warning "'alloca' may be too large" "" { target lp64} }
39 // { dg-message "note:.*argument may be as large as 2999" "note" { target lp64 } 38 }
40 // { dg-warning "unbounded use of 'alloca'" "" { target { ! lp64 } } 38 }
43 p
= __builtin_malloc (n
);