aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2005-02-12 12:02:35 -0800
committerRichard Henderson <rth@gcc.gnu.org>2005-02-12 12:02:35 -0800
commitbd0b34a882a1b4d92cf8945ccc3968819f57892b (patch)
treeebbf8903535c62ebe1aecaccf0b5bd2043c98eb6 /gcc/ada/utils.c
parentc202a7f94fbc1219edcdfcc35d14064ad04232b3 (diff)
downloadgcc-bd0b34a882a1b4d92cf8945ccc3968819f57892b.zip
gcc-bd0b34a882a1b4d92cf8945ccc3968819f57892b.tar.gz
gcc-bd0b34a882a1b4d92cf8945ccc3968819f57892b.tar.bz2
utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes...
* utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes; validate SCALAR_INT_MODE_P before calling gnat_type_for_size. From-SVN: r94946
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 549c093..0ba7381 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -1828,10 +1828,14 @@ gnat_type_for_mode (enum machine_mode mode, int unsignedp)
return NULL_TREE;
else if (mode == VOIDmode)
return void_type_node;
- else if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+ else if (COMPLEX_MODE_P (mode))
+ return NULL_TREE;
+ else if (SCALAR_FLOAT_MODE_P (mode))
return float_type_for_precision (GET_MODE_PRECISION (mode), mode);
- else
+ else if (SCALAR_INT_MODE_P (mode))
return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
+ else
+ gcc_unreachable ();
}
/* Return the unsigned version of a TYPE_NODE, a scalar type. */