https://gcc.gnu.org/g:c7f8a5b466496fb3362ac39a841d47a63c16e501

commit r16-2014-gc7f8a5b466496fb3362ac39a841d47a63c16e501
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Wed Jun 18 09:52:44 2025 +0200

    ada: Add missing guards to previous change
    
    We need to make sure that an integer type exists for the given size.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Add guards.

Diff:
---
 gcc/ada/gcc-interface/decl.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 63c6851d1429..6ea09ea5c365 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -6432,12 +6432,16 @@ gnat_to_gnu_subprog_type (Entity_Id gnat_subprog, bool 
definition,
              tree typ2 = TREE_TYPE (DECL_CHAIN (gnu_cico_field_list));
              if (INTEGRAL_TYPE_P (typ1)
                  && integer_pow2p (TYPE_SIZE (typ2))
+                 && compare_tree_int (TYPE_SIZE (typ2),
+                                      MAX_FIXED_MODE_SIZE) <= 0
                  && tree_int_cst_lt (TYPE_SIZE (typ1), TYPE_SIZE (typ2)))
                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)
                       && integer_pow2p (TYPE_SIZE (typ1))
+                      && compare_tree_int (TYPE_SIZE (typ1),
+                                           MAX_FIXED_MODE_SIZE) <= 0
                       && tree_int_cst_lt (TYPE_SIZE (typ2), TYPE_SIZE (typ1)))
                TREE_TYPE (DECL_CHAIN (gnu_cico_field_list))
                  = gnat_type_for_size (TREE_INT_CST_LOW (TYPE_SIZE (typ1)),

Reply via email to