This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix expansion of cexpi on C99 but non-SINCOS targets
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Jan 2007 14:51:28 +0100 (CET)
- Subject: [PATCH] Fix expansion of cexpi on C99 but non-SINCOS targets
This fixes an oversight of mine. Bootstrapped and tested on
x86_64-unknown-linux-gnu (with TARGET_HAS_SINCOS disabled), committed
to mainline.
Richard.
Index: ChangeLog
===================================================================
*** ChangeLog (revision 121113)
--- ChangeLog (working copy)
***************
*** 1,3 ****
--- 1,8 ----
+ 2007-01-24 Richard Guenther <rguenther@suse.de>
+
+ * builtins.c (expand_builtin_cexpi): Get the fndecl
+ for cexp in the correct way.
+
2007-01-24 Jan Hubicka <jh@suse.cz>
* tree-ssa-dce.c (eliminate_unnecesary_stmts): Remove dead LHS of calls.
Index: builtins.c
===================================================================
*** builtins.c (revision 121113)
--- builtins.c (working copy)
*************** expand_builtin_cexpi (tree exp, rtx targ
*** 2283,2295 ****
}
else
{
! tree call, fn, narg;
tree ctype = build_complex_type (type);
/* We can expand via the C99 cexp function. */
gcc_assert (TARGET_C99_FUNCTIONS);
! fn = mathfn_built_in (ctype, BUILT_IN_CEXP);
narg = fold_build2 (COMPLEX_EXPR, ctype,
build_real (type, dconst0), arg);
--- 2283,2300 ----
}
else
{
! tree call, fn = NULL_TREE, narg;
tree ctype = build_complex_type (type);
/* We can expand via the C99 cexp function. */
gcc_assert (TARGET_C99_FUNCTIONS);
! if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPIF)
! fn = built_in_decls[BUILT_IN_CEXPF];
! else if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPI)
! fn = built_in_decls[BUILT_IN_CEXP];
! else if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CEXPIL)
! fn = built_in_decls[BUILT_IN_CEXPL];
narg = fold_build2 (COMPLEX_EXPR, ctype,
build_real (type, dconst0), arg);