When the frontend clobbers a parameter and that parameter gets
rewritten into SSA then we ICE because we didn't expect this. Avoid
using the parameter decl to create a SSA default def in this case.
PR middle-end/107679
* tree-into-ssa.cc (maybe_register_def): Use new temporary if
we require an uninitialized value for a parameter decl.
* gfortran.dg/pr107679.f90: New testcase.
--- /dev/null
+! { dg-do compile }
+
+subroutine s1(x)
+ integer, intent(out) :: x
+end
+subroutine s2(z)
+ integer, value :: z
+ call s1(z)
+end
{
if (gimple_clobber_p (stmt) && is_gimple_reg (sym))
{
- gcc_checking_assert (VAR_P (sym));
+ tree defvar;
+ if (VAR_P (sym))
+ defvar = sym;
+ else
+ defvar = create_tmp_reg (TREE_TYPE (sym));
/* Replace clobber stmts with a default def. This new use of a
default definition may make it look like SSA_NAMEs have
conflicting lifetimes, so we need special code to let them
coalesce properly. */
to_delete = true;
- def = get_or_create_ssa_default_def (cfun, sym);
+ def = get_or_create_ssa_default_def (cfun, defvar);
}
else
{