This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/31161] __builtin_cexpi is broken on Darwin
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Mar 2007 09:50:24 -0000
- Subject: [Bug target/31161] __builtin_cexpi is broken on Darwin
- References: <bug-31161-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from rguenth at gcc dot gnu dot org 2007-03-16 09:50 -------
Yes, it's supposed to call cexp(complex(0,x)), but now looking at the code
there
seems to be a typo:
narg = fold_build2 (COMPLEX_EXPR, ctype,
build_real (type, dconst0), arg);
/* Make sure not to fold the cexp call again. */
call = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
return expand_expr (build_call_nary (ctype, call, 1, arg),
target, VOIDmode, 0);
it builds the call with 'arg' instead of 'narg'. Argh. This bug was
introduced
by the CALL_EXPR changes:
narg = fold_build2 (COMPLEX_EXPR, ctype,
build_real (type, dconst0), arg);
/* Make sure not to fold the cexp call again. */
call = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
- return expand_expr (build3 (CALL_EXPR, ctype, call,
- build_tree_list (NULL_TREE, narg),
- NULL_TREE), target, VOIDmode, 0);
+ return expand_expr (build_call_nary (ctype, call, 1, arg),
+ target, VOIDmode, 0);
I'll fix it in a second.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31161