PR tree-optimization/84224
* gimple-ssa-warn-alloca.c (pass_walloca::execute): Remove assert.
* calls.c (gimple_alloca_call_p): Only return TRUE when we have
non-zero arguments.
From-SVN: r257480
+2018-02-08 Aldy Hernandez <aldyh@redhat.com>
+
+ PR tree-optimization/84224
+ * gimple-ssa-warn-alloca.c (pass_walloca::execute): Remove assert.
+ * calls.c (gimple_alloca_call_p): Only return TRUE when we have
+ non-zero arguments.
+
2018-02-07 Iain Sandoe <iain@codesourcery.com>
* config/rs6000/altivec.md (*restore_world): Remove LR use.
switch (DECL_FUNCTION_CODE (fndecl))
{
CASE_BUILT_IN_ALLOCA:
- return true;
+ return gimple_call_num_args (stmt) > 0;
default:
break;
}
if (!gimple_alloca_call_p (stmt))
continue;
- gcc_assert (gimple_call_num_args (stmt) >= 1);
const bool is_vla
= gimple_call_alloca_for_var_p (as_a <gcall *> (stmt));
--- /dev/null
+/* PR tree-optimization/84224 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -Walloca" } */
+
+void *alloca ();
+__typeof__(alloca ()) a () { return alloca (); }