Commit 4aecfe19 by Richard Sandiford Committed by Richard Sandiford

Don't create SSA names until in SSA form

An upcoming patch adds a fold from hypot(x,x) to fabs(x)*sqrt(2).
This is unusual in that it could trigger in the gimplifier but would
require new SSA names to be created.  This patch makes sure that we
use the usual:

	  if (gimple_in_ssa_p (cfun))
	    res = make_ssa_name (type);
	  else
	    res = create_tmp_reg (type);

formula to cope with cases where we're not yet in SSA form.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* gimple-match-head.c (maybe_push_res_to_seq): Use create_tmp_reg
	instead of make_ssa_name if not yet in SSA form.

From-SVN: r229406
parent 61183076
2015-10-27 Richard Sandiford <richard.sandiford@arm.com>
* gimple-match-head.c (maybe_push_res_to_seq): Use create_tmp_reg
instead of make_ssa_name if not yet in SSA form.
2015-10-27 Richard Biener <rguenther@suse.de>
* cfg.c (free_edge): Add function argument and use it instead of cfun.
......@@ -331,7 +331,12 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree *ops,
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ops[2])))
return NULL_TREE;
if (!res)
res = make_ssa_name (type);
{
if (gimple_in_ssa_p (cfun))
res = make_ssa_name (type);
else
res = create_tmp_reg (type);
}
maybe_build_generic_op (rcode, type, &ops[0], ops[1], ops[2]);
gimple *new_stmt = gimple_build_assign (res, rcode,
ops[0], ops[1], ops[2]);
......@@ -361,7 +366,12 @@ maybe_push_res_to_seq (code_helper rcode, tree type, tree *ops,
}
gcc_assert (nargs != 0);
if (!res)
res = make_ssa_name (type);
{
if (gimple_in_ssa_p (cfun))
res = make_ssa_name (type);
else
res = create_tmp_reg (type);
}
gimple *new_stmt = gimple_build_call (decl, nargs, ops[0], ops[1], ops[2]);
gimple_call_set_lhs (new_stmt, res);
gimple_seq_add_stmt_without_update (seq, new_stmt);
......
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