Hi,

I'm wondering why for Ada boolean_true_node has a value that is
not in the range of the Ada type but is, for the specific case,
255 instead of 1.  Is there a specific reason for that?

Does the following patch make sense (untested)?

Btw, I wonder if Ada cannot simply use its own boolean_type_node
global tree and leave the middle-ends boolean_type_node alone,
which is supposed to match the C ABI of the target.

Thanks,
Richard.


Index: gcc/ada/gcc-interface/misc.c
===================================================================
--- gcc/ada/gcc-interface/misc.c        (revision 176266)
+++ gcc/ada/gcc-interface/misc.c        (working copy)
@@ -323,7 +323,7 @@ gnat_init (void)
   SET_TYPE_RM_MAX_VALUE (boolean_type_node,
                         build_int_cst (boolean_type_node, 1));
   SET_TYPE_RM_SIZE (boolean_type_node, bitsize_int (1));
-  boolean_true_node = TYPE_MAX_VALUE (boolean_type_node);
+  boolean_true_node = TYPE_RM_MAX_VALUE (boolean_type_node);
   boolean_false_node = TYPE_MIN_VALUE (boolean_type_node);
 
   sbitsize_one_node = sbitsize_int (1);

Reply via email to