Commit 535536b4 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/40669 (ICE in gimple_assign_set_rhs1 from eliminate_tail_call)

	PR middle-end/40669
	* tree-tailcall.c (adjust_return_value_with_ops,
	create_tailcall_accumulator): Set DECL_GIMPLE_REG_P on the temporary
	if it has complex or vector type.

	* gcc.dg/pr40669.c: New test.

From-SVN: r149319
parent d79e621a
2009-07-07 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40669
* tree-tailcall.c (adjust_return_value_with_ops,
create_tailcall_accumulator): Set DECL_GIMPLE_REG_P on the temporary
if it has complex or vector type.
2009-07-07 Olivier Hainque <hainque@adacore.com>
* config/alpha/t-osf4 (SHLIB_LINK): Do not hide the dummy weak
......
2009-07-07 Jakub Jelinek <jakub@redhat.com>
PR middle-end/40669
* gcc.dg/pr40669.c: New test.
2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/plugin/selfassign.c: Replace %H by an explicit
......
/* PR middle-end/40669 */
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */
double _Complex
test (int d, int t, double *x, double *y, double *z, int n,
double _Complex (*fnp) (double))
{
int m = n / 2;
double min = y[t], max = z[t], med = x[m * d + t];
double _Complex result = 0.0;
if (n == 0)
return 0.0;
if (min > med)
result += test (d, (t + 1) % d, x + (m + 1) * d, y, z, n - m - 1, fnp);
else if (max < med)
result += test (d, (t + 1) % d, x, y, z, m, fnp);
else
{
result += fnp (y[0] + x[m]);
result += test (d, (t + 1) % d, x + (m + 1) * d, y, z, n - m - 1, fnp);
}
return result;
}
......@@ -567,6 +567,9 @@ adjust_return_value_with_ops (enum tree_code code, const char *label,
gimple stmt = gimple_build_assign_with_ops (code, tmp, op0, op1);
tree result;
if (TREE_CODE (ret_type) == COMPLEX_TYPE
|| TREE_CODE (ret_type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp) = 1;
add_referenced_var (tmp);
result = make_ssa_name (tmp, stmt);
gimple_assign_set_lhs (stmt, result);
......@@ -861,6 +864,9 @@ create_tailcall_accumulator (const char *label, basic_block bb, tree init)
tree tmp = create_tmp_var (ret_type, label);
gimple phi;
if (TREE_CODE (ret_type) == COMPLEX_TYPE
|| TREE_CODE (ret_type) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (tmp) = 1;
add_referenced_var (tmp);
phi = create_phi_node (tmp, bb);
/* RET_TYPE can be a float when -ffast-maths is enabled. */
......
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