+2017-03-07 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/79809
+ * gimple-ssa-warn-alloca.c (pass_walloca::gate): Use HOST_WIDE_INT.
+ (alloca_call_type): Likewise.
+
2017-03-07 Martin Liska <mliska@suse.cz>
* gcov.c (process_args): Put comment to correct location.
if (first_time_p)
return warn_alloca != 0;
- return warn_alloca_limit > 0 || warn_vla_limit > 0;
+ return ((unsigned HOST_WIDE_INT) warn_alloca_limit > 0
+ || (unsigned HOST_WIDE_INT) warn_vla_limit > 0);
}
// Possible problematic uses of alloca.
wide_int min, max;
struct alloca_type_and_limit ret = alloca_type_and_limit (ALLOCA_UNBOUNDED);
- gcc_assert (!is_vla || warn_vla_limit > 0);
- gcc_assert (is_vla || warn_alloca_limit > 0);
+ gcc_assert (!is_vla || (unsigned HOST_WIDE_INT) warn_vla_limit > 0);
+ gcc_assert (is_vla || (unsigned HOST_WIDE_INT) warn_alloca_limit > 0);
// Adjust warn_alloca_max_size for VLAs, by taking the underlying
// type into account.
--- /dev/null
+/* PR middle-end/79809 */
+/* { dg-do compile } */
+/* { dg-options "-Walloca-larger-than=4207115063 -Wvla-larger-than=1233877270 -O2" } */
+
+int a;
+char *b = static_cast<char *>(__builtin_alloca (a)); // { dg-warning "argument to .alloca. may be too large" }