utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes...
authorRichard Henderson <rth@redhat.com>
Sat, 12 Feb 2005 20:02:35 +0000 (12:02 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 12 Feb 2005 20:02:35 +0000 (12:02 -0800)
        * 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

gcc/ada/ChangeLog
gcc/ada/utils.c

index 862b9e57aa65cdb777caf951f0d499e881f08618..eb7fd064a7aaff08cd46b32f8f6469b7366fe5fd 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-12  Richard Henderson  <rth@redhat.com>
+
+       * utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes;
+       validate SCALAR_INT_MODE_P before calling gnat_type_for_size.
+
 2005-02-10  Andreas Jaeger  <aj@suse.de>
 
        * init.c (__gnat_initialize): Mark parameter as unused.
index 549c0935e6f4a426d5c6312ad94806cd3c7109ad..0ba7381b9045f0bd9df624c009efb24a765795a1 100644 (file)
@@ -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.  */