re PR ada/38127 (ACATS cd1c04e fails on sparc, hppa)
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 16 Nov 2008 10:05:22 +0000 (10:05 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 16 Nov 2008 10:05:22 +0000 (10:05 +0000)
PR ada/38127
* gcc-interface/decl.c (make_type_from_size): Do not special-case
boolean types.
* gcc-interface/targtyps.c: Tweak comment.

From-SVN: r141913

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/targtyps.c

index ec605ab78627365eaf6ab25dab5b17d049674616..0125eb839fa8dfd11586cae21d6f78eff25bd355 100644 (file)
@@ -1,3 +1,10 @@
+2008-11-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR ada/38127
+       * gcc-interface/decl.c (make_type_from_size): Do not special-case
+       boolean types.
+       * gcc-interface/targtyps.c: Tweak comment.
+
 2008-11-15  Geert Bosch  <bosch@adacore.com>
 
        * gcc-interface/trans.c (emit_check): Put back a final save_expr
index 3266e6d3542bbcaa39c92106690812fb23ef958b..35fdb0ce5914bda3f37178004b2e5eca8e21e4ea 100644 (file)
@@ -7184,7 +7184,7 @@ static tree
 make_type_from_size (tree type, tree size_tree, bool for_biased)
 {
   unsigned HOST_WIDE_INT size;
-  bool biased_p, boolean_p;
+  bool biased_p;
   tree new_type;
 
   /* If size indicates an error, just return TYPE to avoid propagating
@@ -7202,19 +7202,10 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
       biased_p = (TREE_CODE (type) == INTEGER_TYPE
                  && TYPE_BIASED_REPRESENTATION_P (type));
 
-      boolean_p = (TREE_CODE (type) == BOOLEAN_TYPE
-                  || (TREE_CODE (type) == INTEGER_TYPE
-                      && TREE_TYPE (type)
-                      && TREE_CODE (TREE_TYPE (type)) == BOOLEAN_TYPE));
-
-      if (boolean_p)
-       size = round_up_to_align (size, BITS_PER_UNIT);
-
       /* Only do something if the type is not a packed array type and
         doesn't already have the proper size.  */
       if (TYPE_PACKED_ARRAY_TYPE_P (type)
-         || (biased_p == for_biased && TYPE_PRECISION (type) == size)
-         || (boolean_p && compare_tree_int (TYPE_SIZE (type), size) == 0))
+         || (TYPE_PRECISION (type) == size && biased_p == for_biased))
        break;
 
       biased_p |= for_biased;
@@ -7224,18 +7215,13 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
        new_type = make_unsigned_type (size);
       else
        new_type = make_signed_type (size);
-      if (boolean_p)
-       TYPE_PRECISION (new_type) = 1;
       TREE_TYPE (new_type) = TREE_TYPE (type) ? TREE_TYPE (type) : type;
       TYPE_MIN_VALUE (new_type)
        = convert (TREE_TYPE (new_type), TYPE_MIN_VALUE (type));
       TYPE_MAX_VALUE (new_type)
        = convert (TREE_TYPE (new_type), TYPE_MAX_VALUE (type));
       TYPE_BIASED_REPRESENTATION_P (new_type) = biased_p;
-      if (boolean_p)
-       TYPE_RM_SIZE_NUM (new_type) = bitsize_int (1);
-      else
-       TYPE_RM_SIZE_NUM (new_type) = bitsize_int (size);
+      TYPE_RM_SIZE_NUM (new_type) = bitsize_int (size);
       return new_type;
 
     case RECORD_TYPE:
index c4e3299667dabe533c0bda7758ff471dfc3de1cf..91572be0c84d620cce1eb6b978550109793d11a0 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                                  Body                                    *
  *                                                                          *
- *          Copyright (C) 1992-2007, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2008, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -164,12 +164,13 @@ get_target_maximum_default_alignment (void)
    Stricter alignment requests trigger gigi's aligning_type circuitry for
    objects allocated by the default allocator.  */
 
+/* ??? Need a way to get info about __gnat_malloc from here (whether it is
+   handy and what alignment it honors).  In the meantime, resort to malloc
+   considerations only.  */
+
 Pos
 get_target_default_allocator_alignment (void)
 {
-  /* ??? Need a way to get info about __gnat_malloc from here (whether
-     it is handy and what alignment it honors).  */
-
   return MALLOC_ABI_ALIGNMENT / BITS_PER_UNIT;
 }