* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149319
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
--- /dev/null
+/* 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;
+}
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);
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. */