From: Eric Botcazou <ebotca...@adacore.com>

The debugger cannot correctly interpret the return value in this case.

gcc/ada/ChangeLog:

        * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Only apply the
        transformation to integer types.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/gcc-interface/decl.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 6ea09ea5c36..86cbf5ba4fb 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -6422,7 +6422,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool 
definition,
       else if (Convention (gnat_subprog) != Convention_Stubbed)
        {
          /* If we have two entries that may be returned in integer registers,
-            the larger has power-of-2 size and the smaller is integral, then
+            the larger has power-of-2 size and the smaller is integer, then
             extend the smaller to this power-of-2 size to get a return type
             with power-of-2 size and no holes, again to speed up accesses.  */
          if (list_length (gnu_cico_field_list) == 2
@@ -6430,7 +6430,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool 
definition,
            {
              tree typ1 = TREE_TYPE (gnu_cico_field_list);
              tree typ2 = TREE_TYPE (DECL_CHAIN (gnu_cico_field_list));
-             if (INTEGRAL_TYPE_P (typ1)
+             if (TREE_CODE (typ1) == INTEGER_TYPE
                  && integer_pow2p (TYPE_SIZE (typ2))
                  && compare_tree_int (TYPE_SIZE (typ2),
                                       MAX_FIXED_MODE_SIZE) <= 0
@@ -6438,7 +6438,7 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool 
definition,
                TREE_TYPE (gnu_cico_field_list)
                  = gnat_type_for_size (TREE_INT_CST_LOW (TYPE_SIZE (typ2)),
                                        TYPE_UNSIGNED (typ1));
-             else if (INTEGRAL_TYPE_P (typ2)
+             else if (TREE_CODE (typ2) == INTEGER_TYPE
                       && integer_pow2p (TYPE_SIZE (typ1))
                       && compare_tree_int (TYPE_SIZE (typ1),
                                            MAX_FIXED_MODE_SIZE) <= 0
-- 
2.43.0

Reply via email to