Commit eacac712 by Aldy Hernandez Committed by Aldy Hernandez

re PR tree-optimization/84224 (ICE in execute, at gimple-ssa-warn-alloca.c:448)

	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
parent 3b263f5a
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> 2018-02-07 Iain Sandoe <iain@codesourcery.com>
* config/rs6000/altivec.md (*restore_world): Remove LR use. * config/rs6000/altivec.md (*restore_world): Remove LR use.
......
...@@ -730,7 +730,7 @@ gimple_alloca_call_p (const gimple *stmt) ...@@ -730,7 +730,7 @@ gimple_alloca_call_p (const gimple *stmt)
switch (DECL_FUNCTION_CODE (fndecl)) switch (DECL_FUNCTION_CODE (fndecl))
{ {
CASE_BUILT_IN_ALLOCA: CASE_BUILT_IN_ALLOCA:
return true; return gimple_call_num_args (stmt) > 0;
default: default:
break; break;
} }
......
...@@ -445,7 +445,6 @@ pass_walloca::execute (function *fun) ...@@ -445,7 +445,6 @@ pass_walloca::execute (function *fun)
if (!gimple_alloca_call_p (stmt)) if (!gimple_alloca_call_p (stmt))
continue; continue;
gcc_assert (gimple_call_num_args (stmt) >= 1);
const bool is_vla const bool is_vla
= gimple_call_alloca_for_var_p (as_a <gcall *> (stmt)); = gimple_call_alloca_for_var_p (as_a <gcall *> (stmt));
......
/* PR tree-optimization/84224 */
/* { dg-do compile } */
/* { dg-options "-O0 -Walloca" } */
void *alloca ();
__typeof__(alloca ()) a () { return alloca (); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment