From: Nathan Froyd <froydnj@codesourcery.com>
To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: [PATCH] use build_function_type_list for float128 functions
Date: Tue, 05 Apr 2011 13:13:00 -0000 [thread overview]
Message-ID: <20110405131253.GA30054@nightcrawler> (raw)
When the real16/float128 bits were added to the Fortran FE, some uses of
build_function_type snuck in. This patch changes them to use
build_function_type_list.
The patch also corrects a small bug: the types for frexp and scalbn had
their argument types in the wrong order.
Tested on x86_64-unknown-linux-gnu. OK to commit?
-Nathan
* trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Use
build_function_type_list instead of build_function_type. Correct
argument order for func_frexp and func_scalbn.
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index a3c2ecd..9a69632 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -621,35 +621,38 @@ gfc_build_intrinsic_lib_fndecls (void)
C99-like library functions. For now, we only handle __float128
q-suffixed functions. */
- tree tmp, func_1, func_2, func_cabs, func_frexp;
+ tree type, complex_type, func_1, func_2, func_cabs, func_frexp;
tree func_lround, func_llround, func_scalbn, func_cpow;
memset (quad_decls, 0, sizeof(tree) * (END_BUILTINS + 1));
+ type = float128_type_node;
+ complex_type = complex_float128_type_node;
/* type (*) (type) */
- tmp = tree_cons (NULL_TREE, float128_type_node, void_list_node);
- func_1 = build_function_type (float128_type_node, tmp);
+ func_1 = build_function_type_list (type, type, NULL_TREE);
/* long (*) (type) */
- func_lround = build_function_type (long_integer_type_node, tmp);
+ func_lround = build_function_type_list (long_integer_type_node,
+ type, NULL_TREE);
/* long long (*) (type) */
- func_llround = build_function_type (long_long_integer_type_node, tmp);
+ func_llround = build_function_type_list (long_long_integer_type_node,
+ type, NULL_TREE);
/* type (*) (type, type) */
- tmp = tree_cons (NULL_TREE, float128_type_node, tmp);
- func_2 = build_function_type (float128_type_node, tmp);
+ func_2 = build_function_type_list (type, type, type, NULL_TREE);
/* type (*) (type, &int) */
- tmp = tree_cons (NULL_TREE, float128_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, build_pointer_type (integer_type_node), tmp);
- func_frexp = build_function_type (float128_type_node, tmp);
+ func_frexp
+ = build_function_type_list (type,
+ type,
+ build_pointer_type (integer_type_node),
+ NULL_TREE);
/* type (*) (type, int) */
- tmp = tree_cons (NULL_TREE, float128_type_node, void_list_node);
- tmp = tree_cons (NULL_TREE, integer_type_node, tmp);
- func_scalbn = build_function_type (float128_type_node, tmp);
+ func_scalbn = build_function_type_list (type,
+ type, integer_type_node, NULL_TREE);
/* type (*) (complex type) */
- tmp = tree_cons (NULL_TREE, complex_float128_type_node, void_list_node);
- func_cabs = build_function_type (float128_type_node, tmp);
+ func_cabs = build_function_type_list (type, complex_type, NULL_TREE);
/* complex type (*) (complex type, complex type) */
- tmp = tree_cons (NULL_TREE, complex_float128_type_node, tmp);
- func_cpow = build_function_type (complex_float128_type_node, tmp);
+ func_cpow
+ = build_function_type_list (complex_type,
+ complex_type, complex_type, NULL_TREE);
#define DEFINE_MATH_BUILTIN(ID, NAME, ARGTYPE)
#define DEFINE_MATH_BUILTIN_C(ID, NAME, ARGTYPE)
next reply other threads:[~2011-04-05 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 13:13 Nathan Froyd [this message]
2011-04-05 14:20 ` Tobias Burnus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110405131253.GA30054@nightcrawler \
--to=froydnj@codesourcery.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).