Hi!

(Before the GCC 12 release) I had reported that commit
r12-6398-ga6eae6a9bbf83ada3aab7f5a2a74e7024889d237
"[Ada] Reduce runtime dependencies on stage1" has broken GCC/Ada build
with GCC 4.8.  That's unfortunate, as I understand that GCC 4.8 is
generally the prerequisite compiler for GCC.  (..., and I like to do
certain build using that old version, to make sure that this still
works.)  (The issue later also got repoted by Bernd Edlinger in
<https://gcc.gnu.org/PR104710> "Ada-Bootstrap fails with gcc-4.8.4".)

I thus had suggested a patch to
'Revert parts of "[Ada] Reduce runtime dependencies on stage1"', but:

On 2022-01-18T10:46:48+0000, Arnaud Charlet via Gcc-patches 
<gcc-patches@gcc.gnu.org> wrote:
>> Unfortunately it's not OK, these are the most annoying/delicate 
>> dependencies, so
>> we'd rather not reintroduce them. I'll instead update prerequisites to
>> document that GCC 5.1 or later is required to build GNAT.
>
> Now pushed on master:
>
>     Update prerequisites for GNAT
>
>         * doc/install.texi: Update prerequisites for GNAT
>
> diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
> index 54ad7c7..96b4dfc 100644
> --- a/gcc/doc/install.texi
> +++ b/gcc/doc/install.texi
> @@ -263,7 +263,7 @@ name of the package depends on your distro) or you must 
> build GCC as a
>  @item @anchor{GNAT-prerequisite}GNAT
>
>  In order to build GNAT, the Ada compiler, you need a working GNAT
> -compiler (GCC version 4.7 or later).
> +compiler (GCC version 5.1 or later).
>
>  This includes GNAT tools such as @command{gnatmake} and
>  @command{gnatlink}, since the Ada front end is written in Ada and

I've now tested that, but find that it doesn't work:

    [...]
    gcc -c -g  -gnatpg -gnatwns -gnata -W -Wall -I- -I. -Iada/generated -Iada 
-I[...]/source-gcc/gcc/ada [...]/source-gcc/gcc/ada/contracts.adb -o 
ada/contracts.o
    +===========================GNAT BUG DETECTED==============================+
    | 5.1.0 (x86_64-unknown-linux-gnu) Assert_Failure sinfo.adb:616            |
    | Error detected at contracts.adb:2231:22                                  |
    | Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
    | 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.                                       |
    +==========================================================================+

    Please include these source files with error report
    Note that list may not be accurate in some cases,
    so please double check that the problem can still
    be reproduced with the set of files listed.
    Consider also -gnatd.n switch (see debug.adb).

    [...]/source-gcc/gcc/ada/contracts.adb
    [...]/source-gcc/gcc/ada/contracts.ads
    [...]/source-gcc/gcc/ada/types.ads
    [...]/source-gcc/gcc/ada/aspects.ads
    [...]/source-gcc/gcc/ada/namet.ads
    [...]/source-gcc/gcc/ada/alloc.ads
    [...]/source-gcc/gcc/ada/hostparm.ads
    [...]/source-gcc/gcc/ada/table.ads
    ada/snames.ads
    [...]/source-gcc/gcc/ada/atree.ads
    [...]/source-gcc/gcc/ada/sinfo.ads
    [...]/source-gcc/gcc/ada/uintp.ads
    [...]/source-gcc/gcc/ada/urealp.ads
    ada/sinfo-nodes.ads
    ada/seinfo.ads
    [...]/source-gcc/gcc/ada/output.ads
    [...]/source-gcc/gcc/ada/einfo.ads
    [...]/source-gcc/gcc/ada/stand.ads
    ada/einfo-entities.ads
    [...]/source-gcc/gcc/ada/einfo-utils.ads
    [...]/source-gcc/gcc/ada/elists.ads
    [...]/source-gcc/gcc/ada/errout.ads
    [...]/source-gcc/gcc/ada/err_vars.ads
    [...]/source-gcc/gcc/ada/erroutc.ads
    [...]/source-gcc/gcc/ada/exp_prag.ads
    [...]/source-gcc/gcc/ada/exp_tss.ads
    [...]/source-gcc/gcc/ada/exp_util.ads
    [...]/source-gcc/gcc/ada/rtsfind.ads
    [...]/source-gcc/gcc/ada/freeze.ads
    [...]/source-gcc/gcc/ada/lib.ads
    ada/gnat.ads
    [...]/source-gcc/gcc/ada/nlists.ads
    ada/nmake.ads
    [...]/source-gcc/gcc/ada/opt.ads
    [...]/source-gcc/gcc/ada/sem.ads
    [...]/source-gcc/gcc/ada/sem_aux.ads
    [...]/source-gcc/gcc/ada/sem_ch6.ads
    [...]/source-gcc/gcc/ada/sem_ch8.ads
    [...]/source-gcc/gcc/ada/sem_ch12.ads
    [...]/source-gcc/gcc/ada/inline.ads
    [...]/source-gcc/gcc/ada/warnsw.ads
    [...]/source-gcc/gcc/ada/sem_ch13.ads
    [...]/source-gcc/gcc/ada/sem_disp.ads
    [...]/source-gcc/gcc/ada/sem_prag.ads
    [...]/source-gcc/gcc/ada/sem_res.ads
    [...]/source-gcc/gcc/ada/sem_type.ads
    [...]/source-gcc/gcc/ada/sem_util.ads
    [...]/source-gcc/gcc/ada/sinfo-utils.ads
    [...]/source-gcc/gcc/ada/sinput.ads
    [...]/source-gcc/gcc/ada/casing.ads
    [...]/source-gcc/gcc/ada/stringt.ads
    [...]/source-gcc/gcc/ada/tbuild.ads

    compilation abandoned
    make[3]: *** [ada/contracts.o] Error 1
    make[3]: Target `all' not remade because of errors.
    make[3]: Leaving directory `[...]/build-gcc/gcc'
    make[2]: *** [all-stage1-gcc] Error 2
    [...]

That 'Assert_Failure sinfo.adb:616' is in 'gcc/ada/sinfo.adb':

    613     function Controlling_Argument
    614        (N : Node_Id) return Node_Id is
    615     begin
    616        pragma Assert (False
    617          or else NT (N).Nkind = N_Function_Call
    618          or else NT (N).Nkind = N_Procedure_Call_Statement);
    619        return Node1 (N);
    620     end Controlling_Argument;

..., which is unchanged over all of the GCC 5 releases; the same
'Assert_Failure' appears for all GCC 5 releases.

The offending 'contracts.adb:2231:22' code is in 'gcc/ada/contracts.adb':

  2226              elsif Scope (Type_Of_Formal) = Scope (Subp_Id) then
  2227                 declare
  2228                    Ignored : Boolean range False .. False;
  2229
  2230                    Typ_Property_Funcs : constant Subprogram_List :=
  2231                       Stable_Properties (Type_Of_Formal, Negated => 
Ignored);
  2232
  2233                    function Excluded_By_Aspect_Spec_Of_Subp
  2234                      (SPF_Id : Entity_Id) return Boolean;

..., which got added in commit
r11-5477-g23e3e22105723fde2a9161757611544f180ba805
"[Ada] Implement AI12-0187 (Stable properties of abstract data types)".

So, what is actually the prerequisite GCC/Ada compiler version to be able
to build GCC 12+ GCC/Ada?


Grüße
 Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to