diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-12 20:02:35 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-12 20:02:35 +0000 |
commit | 5740df121e5c02b415c89ca6a2f964e9709d7ffb (patch) | |
tree | ebbf8903535c62ebe1aecaccf0b5bd2043c98eb6 /gcc/ada/utils.c | |
parent | d90ae6b26437cdfc8a6ce3a9df4d45f1f431cf0e (diff) | |
download | gcc-5740df121e5c02b415c89ca6a2f964e9709d7ffb.tar.gz |
* utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes;
validate SCALAR_INT_MODE_P before calling gnat_type_for_size.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94946 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r-- | gcc/ada/utils.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 549c0935e6f..0ba7381b904 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. */ |