aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2003-10-20 18:28:27 +0000
committerZack Weinberg <zack@gcc.gnu.org>2003-10-20 18:28:27 +0000
commitd1d3865f99c35223f23c8fe9834d9202ca1fbfcf (patch)
tree93e6e2df27043a189891932a5e31bb953211185f /gcc/c-common.c
parent65fc9769d5aae02bd4a32c1756cea36b2be51f82 (diff)
downloadgcc-d1d3865f99c35223f23c8fe9834d9202ca1fbfcf.zip
gcc-d1d3865f99c35223f23c8fe9834d9202ca1fbfcf.tar.gz
gcc-d1d3865f99c35223f23c8fe9834d9202ca1fbfcf.tar.bz2
c-common.c (registered_builtin_types): New static.
* c-common.c (registered_builtin_types): New static. (c_common_type_for_mode): Consult registered_builtin_types. (c_register_builtin_type): Add type to registered_builtin_types. * optabs.c (init_floating_libfuncs): Initialize libfuncs for all MODE_FLOAT modes, not just the ones corresponding to float_type_node, double_type_node, and long_double_type_node. From-SVN: r72711
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index e8ed13b..96186d8e 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1828,6 +1828,10 @@ c_common_type_for_size (unsigned int bits, int unsignedp)
return 0;
}
+/* Used for communication between c_common_type_for_mode and
+ c_register_builtin_type. */
+static GTY(()) tree registered_builtin_types;
+
/* Return a data type that has machine mode MODE.
If the mode is an integer,
then UNSIGNEDP selects between signed and unsigned types. */
@@ -1835,6 +1839,8 @@ c_common_type_for_size (unsigned int bits, int unsignedp)
tree
c_common_type_for_mode (enum machine_mode mode, int unsignedp)
{
+ tree t;
+
if (mode == TYPE_MODE (integer_type_node))
return unsignedp ? unsigned_type_node : integer_type_node;
@@ -1923,6 +1929,10 @@ c_common_type_for_mode (enum machine_mode mode, int unsignedp)
break;
}
+ for (t = registered_builtin_types; t; t = TREE_CHAIN (t))
+ if (TYPE_MODE (TREE_VALUE (t)) == mode)
+ return TREE_VALUE (t);
+
return 0;
}
@@ -2051,6 +2061,8 @@ c_register_builtin_type (tree type, const char* name)
if (!TYPE_NAME (type))
TYPE_NAME (type) = decl;
pushdecl (decl);
+
+ registered_builtin_types = tree_cons (0, type, registered_builtin_types);
}