This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR17687 sincos -> cexp canonicalization (2nd try)


This moves canonicalization from gimplify to fold as requested and
adds folding of cexp as well (as requested).  To produce a testcase
for the latter I had to add some folding of complex expressions to
allow making cexp with an imaginary argument visible to fold.  Also
gcc.c-torture/execute/complex-1.c needs adjustment because it defines
its own cexp with different semantics.

Bootstrapped and tested on x86_64-unknown-linux-gnu,

ok for mainline?

Thanks,
Richard.

:ADDPATCH middle-end:

2006-12-06  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/17687
	* builtins.def (BUILT_IN_CEXPI, BUILT_IN_CEXPIF, BUILT_IN_CEXPIL):
	New builtins for imaginary argument cexp.
	* builtin-types.def (BT_FN_COMPLEX_FLOAT_FLOAT,
	BT_FN_COMPLEX_DOUBLE_DOUBLE, BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE):
	New required builtin types.
	* builtins.c (expand_builtin_cexpi): Declare.
	(mathfn_built_in): Handle BUILT_IN_CEXPI.
	(expand_builtin_cexpi): New static helper.
	(expand_builtin): Call it.
	(fold_builtin_1): Handle folding of CEXPI.
	(do_mpfr_sincos): Adjust for CEXPI evaluation.
	(fold_builtin_sincos): New function to fold sincos to cepxi.
	(fold_builtin_cexp): New function to fold cexp to cexpi and
	exp parts.
	* fold-const.c (fold_unary): Fold REALPART_EXPR of cexpi to
	cos.  Fold IMAGPART_EXPR of cexpi to sin.
	(fold_complex_binary): New function.
	(fold_binary): Call it to handle COMPLEX_EXPR <x, 0> *
	COMPLEX_CST <0, 1> folding to COMPLEX_EXPR <0, x>.

	* gcc.c-torture/execute/complex-1.c: Fix function name.
	* gcc.dg/builtins-60.c: New testcase.

Index: fold-const.c
===================================================================
*** fold-const.c	(revision 119650)
--- fold-const.c	(working copy)
*************** fold_unary (enum tree_code code, tree ty
*** 7715,7720 ****
--- 7715,7732 ----
  	  tem = fold_build1 (REALPART_EXPR, itype, TREE_OPERAND (arg0, 0));
  	  return fold_convert (type, tem);
  	}
+       if (TREE_CODE (arg0) == CALL_EXPR)
+ 	{
+ 	  tree fn = get_callee_fndecl (arg0);
+ 	  switch (DECL_FUNCTION_CODE (fn))
+ 	    {
+ 	    CASE_FLT_FN (BUILT_IN_CEXPI):
+ 	      fn = mathfn_built_in (type, BUILT_IN_COS);
+ 	      return build_function_call_expr (fn, TREE_OPERAND (arg0, 1));
+ 
+ 	    default:;
+ 	    }
+ 	}
        return NULL_TREE;
  
      case IMAGPART_EXPR:
*************** fold_unary (enum tree_code code, tree ty
*** 7741,7746 ****
--- 7753,7770 ----
  	  tem = fold_build1 (IMAGPART_EXPR, itype, TREE_OPERAND (arg0, 0));
  	  return fold_convert (type, negate_expr (tem));
  	}
+       if (TREE_CODE (arg0) == CALL_EXPR)
+ 	{
+ 	  tree fn = get_callee_fndecl (arg0);
+ 	  switch (DECL_FUNCTION_CODE (fn))
+ 	    {
+ 	    CASE_FLT_FN (BUILT_IN_CEXPI):
+ 	      fn = mathfn_built_in (type, BUILT_IN_SIN);
+ 	      return build_function_call_expr (fn, TREE_OPERAND (arg0, 1));
+ 
+ 	    default:;
+ 	    }
+ 	}
        return NULL_TREE;
  
      default:
*************** fold_mult_zconjz (tree type, tree expr)
*** 8456,8461 ****
--- 8480,8544 ----
  		      fold_convert (itype, integer_zero_node));
  }
  
+ /* Fold complex binary operations of ARG0 and ARG1 in type TYPE.
+    Returns a simplified tree if possible. */
+ 
+ static tree
+ fold_complex_binary (enum tree_code code, tree type, tree arg0, tree arg1)
+ {
+   tree arg0r, arg0i, arg1r, arg1i;
+   bool arg0rz, arg0ro, arg0iz, arg0io;
+   bool arg1rz, arg1ro, arg1iz, arg1io;
+ 
+   if (HONOR_SNANS (TYPE_MODE (TREE_TYPE (type)))
+       || !((TREE_CODE (arg0) == COMPLEX_EXPR
+ 	   || TREE_CODE (arg0) == COMPLEX_CST)
+ 	   && (TREE_CODE (arg1) == COMPLEX_EXPR
+  	       || TREE_CODE (arg1) == COMPLEX_CST)))
+     return NULL_TREE;
+ 
+   if (TREE_CODE (arg0) == COMPLEX_CST)
+     {
+       arg0r = TREE_REALPART (arg0);
+       arg0i = TREE_IMAGPART (arg0);
+     }
+   else
+     {
+       arg0r = TREE_OPERAND (arg0, 0);
+       arg0i = TREE_OPERAND (arg0, 1);
+     }
+   arg0rz = real_zerop (arg0r);
+   arg0ro = real_onep (arg0r);
+   arg0iz = real_zerop (arg0i);
+   arg0io = real_onep (arg0i);
+ 
+   if (TREE_CODE (arg1) == COMPLEX_CST)
+     {
+       arg1r = TREE_REALPART (arg1);
+       arg1i = TREE_IMAGPART (arg1);
+     }
+   else
+     {
+       arg1r = TREE_OPERAND (arg1, 0);
+       arg1i = TREE_OPERAND (arg1, 1);
+     }
+   arg1rz = real_zerop (arg1r);
+   arg1ro = real_onep (arg1r);
+   arg1iz = real_zerop (arg1i);
+   arg1io = real_onep (arg1i);
+ 
+   switch (code)
+     {
+     case MULT_EXPR:
+       /* { x, 0.0 } * { 0.0, 1.0 } is { 0.0, x } */
+       if (arg0iz && arg1rz && arg1io)
+         return fold_build2 (COMPLEX_EXPR, type, arg0i, arg0r);
+ 
+     default:;
+     }
+ 
+   return NULL_TREE;
+ }
  
  /* Fold a binary expression of code CODE and type TYPE with operands
     OP0 and OP1.  Return the folded expression if folding is
*************** fold_binary (enum tree_code code, tree t
*** 9181,9186 ****
--- 9264,9277 ----
  		}
  	    }
  
+ 	  /* Fold COMPLEX_EXPR <x, 0> * COMPLEX_EXPR <0, y> as it
+ 	     happens for x * 1.iF to produce imaginary x.  */
+ 	  if ((TREE_CODE (arg0) == COMPLEX_EXPR
+ 	       || TREE_CODE (arg0) == COMPLEX_CST)
+ 	      && (TREE_CODE (arg1) == COMPLEX_EXPR
+ 	 	  || TREE_CODE (arg1) == COMPLEX_CST))
+ 	    return fold_complex_binary (code, type, arg0, arg1);
+ 
  	  /* Optimize z * conj(z) for floating point complex numbers.
  	     Guarded by flag_unsafe_math_optimizations as non-finite
  	     imaginary components don't produce scalar results.  */
Index: builtins.c
===================================================================
*** builtins.c	(revision 119650)
--- builtins.c	(working copy)
*************** static rtx expand_builtin_mathfn (tree, 
*** 95,100 ****
--- 95,101 ----
  static rtx expand_builtin_mathfn_2 (tree, rtx, rtx);
  static rtx expand_builtin_mathfn_3 (tree, rtx, rtx);
  static rtx expand_builtin_sincos (tree);
+ static rtx expand_builtin_cexpi (tree, rtx, rtx);
  static rtx expand_builtin_int_roundingfn (tree, rtx, rtx);
  static rtx expand_builtin_int_roundingfn_2 (tree, rtx, rtx);
  static rtx expand_builtin_args_info (tree);
*************** mathfn_built_in (tree type, enum built_i
*** 1651,1656 ****
--- 1652,1658 ----
        CASE_MATHFN (BUILT_IN_ATANH)
        CASE_MATHFN (BUILT_IN_CBRT)
        CASE_MATHFN (BUILT_IN_CEIL)
+       CASE_MATHFN (BUILT_IN_CEXPI)
        CASE_MATHFN (BUILT_IN_COPYSIGN)
        CASE_MATHFN (BUILT_IN_COS)
        CASE_MATHFN (BUILT_IN_COSH)
*************** expand_builtin_sincos (tree exp)
*** 2218,2223 ****
--- 2220,2294 ----
    return const0_rtx;
  }
  
+ /* Expand a call to the internal cexpi builtin to the sincos math function.
+    EXP is the expression that is a call to the builtin function; if convenient,
+    the result should be placed in TARGET.  SUBTARGET may be used as the target
+    for computing one of EXP's operands.  */
+ 
+ static rtx
+ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
+ {
+   tree fndecl = get_callee_fndecl (exp);
+   tree arglist = TREE_OPERAND (exp, 1);
+   enum machine_mode mode;
+   tree arg, type;
+   rtx op0, op1, op2;
+ 
+   if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
+     return 0;
+ 
+   arg = TREE_VALUE (arglist);
+   type = TREE_TYPE (arg);
+   mode = TYPE_MODE (TREE_TYPE (arg));
+ 
+   /* Try expanding via a sincos optab, fall back to emitting a libcall
+      to sincos.  We are sure we have sincos either way because cexpi
+      is only generated from sincos.  */
+   if (sincos_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
+     {
+       op1 = gen_reg_rtx (mode);
+       op2 = gen_reg_rtx (mode);
+ 
+       op0 = expand_expr (arg, subtarget, VOIDmode, 0);
+ 
+       /* Compute into op1 and op2.  */
+       expand_twoval_unop (sincos_optab, op0, op2, op1, 0);
+     }
+   else
+     {
+       tree narglist, fn = NULL_TREE;
+       tree top1, top2;
+       rtx op1a, op2a;
+ 
+       if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPIF)
+ 	fn = built_in_decls[BUILT_IN_SINCOSF];
+       else if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPI)
+ 	fn = built_in_decls[BUILT_IN_SINCOS];
+       else if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPIL)
+ 	fn = built_in_decls[BUILT_IN_SINCOSL];
+       gcc_assert (fn);
+  
+       op1 = assign_temp (TREE_TYPE (arg), 0, 1, 1);
+       op2 = assign_temp (TREE_TYPE (arg), 0, 1, 1);
+       op1a = copy_to_mode_reg (Pmode, XEXP (op1, 0));
+       op2a = copy_to_mode_reg (Pmode, XEXP (op2, 0));
+       top1 = make_tree (build_pointer_type (TREE_TYPE (arg)), op1a);
+       top2 = make_tree (build_pointer_type (TREE_TYPE (arg)), op2a);
+ 
+       narglist = build_tree_list (NULL_TREE, arg);
+       narglist = tree_cons (NULL_TREE, top1, narglist);
+       narglist = tree_cons (NULL_TREE, top2, narglist);
+ 
+       expand_normal (build_function_call_expr (fn, narglist));
+     }
+ 
+   /* Now build the proper return type.  */
+   return expand_expr (build2 (COMPLEX_EXPR, build_complex_type (type),
+ 			      make_tree (TREE_TYPE (arg), op2),
+ 			      make_tree (TREE_TYPE (arg), op1)),
+ 		      target, VOIDmode, 0);
+ }
+ 
  /* Expand a call to one of the builtin rounding functions gcc defines
     as an extension (lfloor and lceil).  As these are gcc extensions we
     do not need to worry about setting errno to EDOM.
*************** expand_builtin (tree exp, rtx target, rt
*** 5775,5780 ****
--- 5846,5856 ----
  	return target;
        break;
  
+     CASE_FLT_FN (BUILT_IN_CEXPI):
+       target = expand_builtin_cexpi (exp, target, subtarget);
+       gcc_assert (target);
+       return target;
+ 
      CASE_FLT_FN (BUILT_IN_SIN):
      CASE_FLT_FN (BUILT_IN_COS):
        if (! flag_unsafe_math_optimizations)
*************** fold_builtin_tan (tree arglist, tree typ
*** 7252,7257 ****
--- 7328,7430 ----
    return NULL_TREE;
  }
  
+ /* Fold function call to builtin sincos, sincosf, or sincosl.  Return
+    NULL_TREE if no simplification can be made.  */
+ 
+ static tree
+ fold_builtin_sincos (tree arglist, tree type)
+ {
+   tree arg0, arg1, arg2;
+   tree res, fn, call;
+ 
+   if (!validate_arglist (arglist, REAL_TYPE, POINTER_TYPE,
+ 			 POINTER_TYPE, VOID_TYPE))
+     return NULL_TREE;
+ 
+   arg0 = TREE_VALUE (arglist);
+   arg1 = TREE_VALUE (TREE_CHAIN (arglist));
+   arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
+ 
+   /* Calculate the result when the argument is a constant.  */
+   if ((res = do_mpfr_sincos (arg0, arg1, arg2)))
+     return res;
+ 
+   /* Canonicalize sincos to cexpi.  */
+   fn = mathfn_built_in (type, BUILT_IN_CEXPI);
+   if (!fn)
+     return NULL_TREE;
+ 
+   call = builtin_save_expr (build_function_call_expr (fn, arg0));
+   return build2 (COMPOUND_EXPR, type,
+ 		 build2 (MODIFY_EXPR, void_type_node,
+ 			 build_fold_indirect_ref (arg1),
+ 			 build1 (IMAGPART_EXPR, type, call)),
+ 		 build2 (MODIFY_EXPR, void_type_node,
+ 			 build_fold_indirect_ref (arg2),
+ 			 build1 (REALPART_EXPR, type, call)));
+ }
+ 
+ /* Fold function call to builtin cexp, cexpf, or cexpl.  Return
+    NULL_TREE if no simplification can be made.  */
+ 
+ static tree
+ fold_builtin_cexp (tree arglist, tree type)
+ {
+   tree arg0, rtype;
+   tree realp, imagp, ifn;
+ 
+   if (!validate_arglist (arglist, COMPLEX_TYPE, VOID_TYPE))
+     return NULL_TREE;
+ 
+   arg0 = TREE_VALUE (arglist);
+   rtype = TREE_TYPE (TREE_TYPE (arg0));
+ 
+   /* In case we can figure out the real part of arg0 and it is constant zero
+      fold to cexpi.  */
+   ifn = mathfn_built_in (rtype, BUILT_IN_CEXPI);
+   if (!ifn)
+     return NULL_TREE;
+ 
+   if ((realp = fold_unary (REALPART_EXPR, rtype, arg0))
+       && real_zerop (realp))
+     {
+       tree narg = fold_build1 (IMAGPART_EXPR, rtype, arg0);
+       return build_function_call_expr (ifn, build_tree_list (NULL_TREE, narg));
+     }
+ 
+   /* In case we can easily decompose real and imaginary parts split cexp
+      to exp (r) * cexpi (i).  */
+   if (flag_unsafe_math_optimizations
+       && realp)
+     {
+       tree rfn, rcall, icall;
+ 
+       rfn = mathfn_built_in (rtype, BUILT_IN_EXP);
+       if (!rfn)
+ 	return NULL_TREE;
+ 
+       imagp = fold_unary (IMAGPART_EXPR, rtype, arg0);
+       if (!imagp)
+ 	return NULL_TREE;
+ 
+       icall = build_function_call_expr (ifn,
+ 				        build_tree_list (NULL_TREE, imagp));
+       icall = builtin_save_expr (icall);
+       rcall = build_function_call_expr (rfn,
+ 				        build_tree_list (NULL_TREE, realp));
+       rcall = builtin_save_expr (rcall);
+       return build2 (COMPLEX_EXPR, type,
+ 		     build2 (MULT_EXPR, rtype,
+ 			     rcall,
+ 			     build1 (REALPART_EXPR, rtype, icall)),
+ 		     build2 (MULT_EXPR, rtype,
+ 			     rcall,
+ 			     build1 (IMAGPART_EXPR, rtype, icall)));
+     }
+ 
+   return NULL_TREE;
+ }
+ 
  /* Fold function call to builtin trunc, truncf or truncl.  Return
     NULL_TREE if no simplification can be made.  */
  
*************** fold_builtin_1 (tree fndecl, tree arglis
*** 9195,9204 ****
        return fold_builtin_tan (arglist, type);
  
      CASE_FLT_FN (BUILT_IN_SINCOS):
!       if (validate_arglist (arglist, REAL_TYPE, POINTER_TYPE, POINTER_TYPE, VOID_TYPE))
! 	return do_mpfr_sincos (TREE_VALUE (arglist), TREE_VALUE (TREE_CHAIN (arglist)),
! 			       TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))));
!     break;
  
      CASE_FLT_FN (BUILT_IN_SINH):
        if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
--- 9368,9381 ----
        return fold_builtin_tan (arglist, type);
  
      CASE_FLT_FN (BUILT_IN_SINCOS):
!       return fold_builtin_sincos (arglist, type);
! 
!     CASE_FLT_FN (BUILT_IN_CEXP):
!       return fold_builtin_cexp (arglist, type);
! 
!     CASE_FLT_FN (BUILT_IN_CEXPI):
!       if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
! 	return do_mpfr_sincos (TREE_VALUE (arglist), NULL_TREE, NULL_TREE);
  
      CASE_FLT_FN (BUILT_IN_SINH):
        if (validate_arglist (arglist, REAL_TYPE, VOID_TYPE))
*************** do_mpfr_arg3 (tree arg1, tree arg2, tree
*** 11670,11675 ****
--- 11847,11854 ----
  
  /* If argument ARG is a REAL_CST, call mpfr_sin_cos() on it and set
     the pointers *(ARG_SINP) and *(ARG_COSP) to the resulting values.
+    If ARG_SINP and ARG_COSP are NULL then the result is returned
+    as a complex value.
     The type is taken from the type of ARG and is used for setting the
     precision of the calculation and results.  */
  
*************** do_mpfr_sincos (tree arg, tree arg_sinp,
*** 11701,11706 ****
--- 11880,11890 ----
  	  mpfr_clears (m, ms, mc, NULL);
  	  if (result_s && result_c)
  	    {
+ 	      /* If we are to return in a complex value do so.  */
+ 	      if (!arg_sinp && !arg_cosp)
+ 		return build_complex (build_complex_type (type),
+ 				      result_c, result_s);
+ 
  	      /* Dereference the sin/cos pointer arguments.  */
  	      arg_sinp = build_fold_indirect_ref (arg_sinp);
  	      arg_cosp = build_fold_indirect_ref (arg_cosp);
Index: builtin-types.def
===================================================================
*** builtin-types.def	(revision 119650)
--- builtin-types.def	(working copy)
*************** DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_COMPLE
*** 159,164 ****
--- 159,170 ----
  		     BT_DOUBLE, BT_COMPLEX_DOUBLE)
  DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE,
  		     BT_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
+ DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_FLOAT_FLOAT,
+ 		     BT_COMPLEX_FLOAT, BT_FLOAT)
+ DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_DOUBLE_DOUBLE,
+ 		     BT_COMPLEX_DOUBLE, BT_DOUBLE)
+ DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE,
+ 		     BT_COMPLEX_LONGDOUBLE, BT_LONGDOUBLE)
  DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UINT, BT_PTR, BT_UINT)
  DEF_FUNCTION_TYPE_1 (BT_FN_PTR_SIZE, BT_PTR, BT_SIZE)
  DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
Index: builtins.def
===================================================================
*** builtins.def	(revision 119650)
--- builtins.def	(working copy)
*************** DEF_C99_BUILTIN        (BUILT_IN_CCOSL, 
*** 452,457 ****
--- 452,460 ----
  DEF_C99_BUILTIN        (BUILT_IN_CEXP, "cexp", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
  DEF_C99_BUILTIN        (BUILT_IN_CEXPF, "cexpf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
  DEF_C99_BUILTIN        (BUILT_IN_CEXPL, "cexpl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
+ DEF_GCC_BUILTIN        (BUILT_IN_CEXPI, "cexpi", BT_FN_COMPLEX_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
+ DEF_GCC_BUILTIN        (BUILT_IN_CEXPIF, "cexpif", BT_FN_COMPLEX_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
+ DEF_GCC_BUILTIN        (BUILT_IN_CEXPIL, "cexpil", BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
  DEF_C99_BUILTIN        (BUILT_IN_CIMAG, "cimag", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
  DEF_C99_BUILTIN        (BUILT_IN_CIMAGF, "cimagf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
  DEF_C99_BUILTIN        (BUILT_IN_CIMAGL, "cimagl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
Index: testsuite/gcc.dg/builtins-60.c
===================================================================
*** testsuite/gcc.dg/builtins-60.c	(revision 0)
--- testsuite/gcc.dg/builtins-60.c	(revision 0)
***************
*** 0 ****
--- 1,31 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O -ffast-math -fdump-tree-optimized" } */
+ 
+ double test1 (double x)
+ {
+   return __real __builtin_cexp(x * (__extension__ 1.0iF));
+ }
+ 
+ double test2(double x)
+ {
+   return __imag __builtin_cexp((__extension__ 1.0iF) * x);
+ }
+ 
+ double test3(double x)
+ {
+   _Complex c = __builtin_cexp(x * (__extension__ 1.0iF));
+   return __imag c + __real c;
+ }
+ 
+ double test4(double x, double y)
+ {
+   _Complex c = __builtin_cexp(x);
+   x = __builtin_exp (x);
+   return x - __real c;
+ }
+ 
+ /* { dg-final { scan-tree-dump "cexpi" "optimized" } } */
+ /* { dg-final { scan-tree-dump "sin" "optimized" } } */
+ /* { dg-final { scan-tree-dump "cos" "optimized" } } */
+ /* { dg-final { scan-tree-dump "return 0.0" "optimized" { xfail *-*-* } } } */
+ /* { dg-final { cleanup-tree-dump "optimized" } } */
Index: testsuite/gcc.c-torture/execute/complex-1.c
===================================================================
*** testsuite/gcc.c-torture/execute/complex-1.c	(revision 119650)
--- testsuite/gcc.c-torture/execute/complex-1.c	(working copy)
*************** g2 (double x)
*** 17,23 ****
  }
  
  __complex__ double
! cexp (__complex__ double x)
  {
    double r;
  
--- 17,23 ----
  }
  
  __complex__ double
! xcexp (__complex__ double x)
  {
    double r;
  
*************** main ()
*** 31,37 ****
  {
    __complex__ double x;
  
!   x = cexp (1.0i);
    if (__real__ x != -1.0)
      abort ();
    if (__imag__ x != 0.0)
--- 31,37 ----
  {
    __complex__ double x;
  
!   x = xcexp (1.0i);
    if (__real__ x != -1.0)
      abort ();
    if (__imag__ x != 0.0)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]