]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
builtins.c (expand_builtin_cexpi): Get the fndecl for cexp in the correct way.
authorRichard Guenther <rguenther@suse.de>
Wed, 24 Jan 2007 13:49:18 +0000 (13:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 24 Jan 2007 13:49:18 +0000 (13:49 +0000)
2007-01-24  Richard Guenther  <rguenther@suse.de>

* builtins.c (expand_builtin_cexpi): Get the fndecl
for cexp in the correct way.

From-SVN: r121114

gcc/ChangeLog
gcc/builtins.c

index de64b881792a1d8755e45d3e89277f95afb5855f..61a4798a355f8107d80cbde7673b2fbf382528e2 100644 (file)
@@ -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 bf57c7bf55e0e96e523cb897d2e3fdafccb82c5d..240231e538b39dd6a8f34d97679447bb4e7d6c82 100644 (file)
@@ -2283,13 +2283,18 @@ expand_builtin_cexpi (tree exp, rtx target, rtx subtarget)
     }
   else
     {
-      tree call, fn, narg;
+      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);
 
-      fn = mathfn_built_in (ctype, BUILT_IN_CEXP);
+      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);