Hi Eric,

sorry for breaking Ada over the weekend, however...

On Fri, May 14 2021, Eric Botcazou wrote:
>> Looks like this caused:
>> 
>>                 === acats tests ===
>> FAIL:   c41325a

None of the non-ACATS tests fail for me without doing a bootstrap, but I
did manage to reproduce this one (by the way, there really should be a
documentation on how to run ACATS tests manually, I should not need to
spend an hour and half figuring it out).

The problem is that before (early) SRA, there is a TREE_READONLY decl
that is being written to and my patch eliminated those writes.
Specifically, I see:

  <bb 183> :
  var_ara_5D.5012.FD.4868[1]{lb: 1 sz: 4}[1]{lb: 1 sz: 1} = _877;
  _880 = report.ident_bool (1);

  <bb 184> :
  var_ara_5D.5012.FD.4868[1]{lb: 1 sz: 4}[2]{lb: 1 sz: 1} = _880;
  _883 = report.ident_bool (1);

  <bb 185> :
  var_ara_5D.5012.FD.4868[1]{lb: 1 sz: 4}[3]{lb: 1 sz: 1} = _883;
  _886 = report.ident_bool (1);

  <bb 186> :
  var_ara_5D.5012.FD.4868[1]{lb: 1 sz: 4}[4]{lb: 1 sz: 1} = _886;
  _889 = report.ident_bool (1);

[...and many more.]  Note that this is an -fdump-tree-all-uid dump, the
DECL that is being assigned to has DECL_UID 5012 and when I dump it:

DECL_UID of racc->base is: 5012
print_node (dump_file, "", racc->base, 0):
 <var_decl 0x7fc249fbc5a0 var_ara_5
    type <record_type 0x7fc249faf690 c41325a__p__p__obj_ara_5___PAD 
sizes-gimplified type_5 TI
        size <integer_cst 0x7fc24b13dc00 constant 128>
        unit-size <integer_cst 0x7fc24b13dc18 constant 16>
        align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 
0x7fc249faf690
        fields <field_decl 0x7fc249fb02f8 F type <array_type 0x7fc249faf1f8 
c41325a__p__array_5>
            decl_3 TI c41325a.adb:57:11
            size <integer_cst 0x7fc24b13dc00 constant 128>
            unit-size <integer_cst 0x7fc24b13dc18 constant 16>
            align:8 warn_if_not_align:0 offset_align 128
            offset <integer_cst 0x7fc24b13dbe8 constant 0>
            bit-offset <integer_cst 0x7fc24b13dc30 constant 0> context 
<record_type 0x7fc249faf690 c41325a__p__p__obj_ara_5___PAD>> context 
<function_decl 0x7fc249f89d00 c41325a>
        Ada size <integer_cst 0x7fc24b13dc00 constant 128>
        pointer_to_this <pointer_type 0x7fc249d4e7e0> chain <type_decl 
0x7fc249fb0390 c41325a__p__p__obj_ara_5___PAD>>
--> readonly TI c41325a.adb:70:6      
    size <integer_cst 0x7fc24b13dc00 type <integer_type 0x7fc24b1520a8 
bitsizetype> constant 128>
    unit-size <integer_cst 0x7fc24b13dc18 type <integer_type 0x7fc24b152000 
sizetype> constant 16>
    align:64 warn_if_not_align:0 context <function_decl 0x7fc249f89d00 c41325a> 
chain <var_decl 0x7fc249fbc630 var_ara_6>>

I can see that base is TREE_READONLY.

Am I right that this is a bug happening at some point earlier in the Ada
compiler?

Would you please have a look at why this is so?  Otherwise I can modify
my patch to only consider TREE_READONLY meaningful for PARM_DECLs but
that does not seem right.

Thanks,

Martin


>> FAIL:   c45347d
>> FAIL:   c74402a
>> FAIL:   c95085m
>> FAIL:   cc3601a
>> 
>>                 === gnat tests ===
>> 
>> FAIL: gnat.dg/addr12.adb (test for excess errors)
>> UNRESOLVED: gnat.dg/addr12.adb compilation failed to produce executable
>> FAIL: gnat.dg/addr12_a.adb (test for excess errors)
>> FAIL: gnat.dg/bip_overlay.adb (test for excess errors)
>> FAIL: gnat.dg/global.adb (test for excess errors)
>> FAIL: gnat.dg/spark1.adb  (test for errors, line 8)
>> FAIL: gnat.dg/spark1.adb (test for excess errors)
>> FAIL: gnat.dg/sync2.adb (test for excess errors)
>> FAIL: gnat.dg/synchronized1.adb (test for excess errors)
>
> Yes, it did, as well as PR boostrap/100597 probably.
>
> -- 
> Eric Botcazou

Reply via email to