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

            Bug ID: 102187
           Summary: Ada LTO bootstrap broken on x86_64 since
                    r12-2927-g29020d0527512a
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
                CC: ebotcazou at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

When attempting to LTO-bootstrap Ada on x86_64 machines, I get the
following ICE:

/home/mjambor/gcc/mine/b-obj/./prev-gcc/xgcc
-B/home/mjambor/gcc/mine/b-obj/./prev-gcc/
-B/home/mjambor/gcc/mine/inst/x86_64-pc-linux-gnu/bin/
-B/home/mjambor/gcc/mine/inst/x86_64-pc-linux-gnu/bin/
-B/home/mjambor/gcc/mine/inst/x86_64-pc-linux-gnu/lib/ -isystem
/home/mjambor/gcc/mine/inst/x86_64-pc-linux-gnu/include -isystem
/home/mjambor/gcc/mine/inst/x86_64-pc-linux-gnu/sys-include   -fno-checking -c
-g -O2 -fno-checking -flto=jobserver -frandom-seed=1  -gnatpg -gnata -W -Wall
-nostdinc -I- -I. -Iada/generated -Iada -I/home/mjambor/gcc/mine/src/gcc/ada
-Iada/libgnat -I/home/mjambor/gcc/mine/src/gcc/ada/libgnat -Iada/gcc-interface
-I/home/mjambor/gcc/mine/src/gcc/ada/gcc-interface
/home/mjambor/gcc/mine/src/gcc/ada/exp_dist.adb -o ada/exp_dist.o
+===========================GNAT BUG DETECTED==============================+
| 12.0.0 20210901 (experimental) (x86_64-pc-linux-gnu) GCC error:          |
| in get_base_type_offset, at dwarf2out.c:4330                             |
| Error detected around
/home/mjambor/gcc/mine/src/gcc/ada/exp_dist.adb:11655:1|
| Compiling /home/mjambor/gcc/mine/src/gcc/ada/exp_dist.adb                |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

(I'm omitting the long lit of "sources listed below," just run LTO
bootstrap with Ada to reproduce).

I have bisected it down to:

29020d0527512ae0444ad32b1461b7f8526e7427 is the first bad commit
commit 29020d0527512ae0444ad32b1461b7f8526e7427
Author: Eric Botcazou <ebotca...@gcc.gnu.org>
Date:   Mon Aug 16 12:14:12 2021 +0200

    Disable GNAT encodings by default

    Given the latest work in the compiler and debugger, we no longer need to
use
    most GNAT-specific encodings in the debug info generated for an Ada
program,
    so the attached patch disables them, except with -fgnat-encodings=all.

    gcc/
            * dwarf2out.c (add_data_member_location_attribute): Use GNAT
            encodings only when -fgnat-encodings=all is specified.
            (add_bound_info): Likewise.
            (add_byte_size_attribute): Likewise.
            (gen_member_die): Likewise.

 gcc/dwarf2out.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)
bisect run success


FWIW, my configure options I used when bisecting are just:
--enable-languages=c,c++,ada --enable-checking=yes --disable-libsanitizer
--disable-libgomp --with-build-config=bootstrap-lto

Reply via email to