https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117087

            Bug ID: 117087
           Summary: [15 Regression] Ada bootstrap failure in validate_size
                    since r15-4166-g9fd38cc5d63612
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefansf at gcc dot gnu.org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---
            Target: s390-*-*

Bootstrapping on s390 for 31 bit fails with

$ ./gcc/xgcc -B/devel/gcc-0-vanilla/build/./gcc/
-B/devel/gcc-0-vanilla/dst/s390x-ibm-linux-gnu/bin/
-B/devel/gcc-0-vanilla/dst/s390x-ibm-linux-gnu/lib/ -isystem
/devel/gcc-0-vanilla/dst/s390x-ibm-linux-gnu/include -isystem
/devel/gcc-0-vanilla/dst/s390x-ibm-linux-gnu/sys-include    -c -g -O2 -m31
-fPIC -fno-lto  -W -Wall -gnatpg -nostdinc -m31  a-assert.adb -o a-assert.o

system.ads:1:01: error: size for "Access_Character" too small, minimum allowed
is 35

Bisect stops at r15-4166-g9fd38cc5d63612

With the following fix, bootstrap is restored for me.

diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index 79d60c0c221..f22dea0d2cf 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -9604,7 +9604,7 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id
gnat_object,
   /* If this is an access type or a fat pointer, the minimum size is that
given
      by the default pointer mode.  */
   if (TREE_CODE (gnu_type) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P
(gnu_type))
-    old_size = bitsize_int (ptr_mode);
+    old_size = bitsize_int (GET_MODE_BITSIZE (ptr_mode));

   /* Issue an error either if the default size of the object isn't a constant
      or if the new size is smaller than it.  */

Reply via email to