https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117038
Bug ID: 117038
Summary: [15 regression] Ada bootstrap fails with LTO errors
(fe.h:361:23: error: type of ‘sinput__c_source_buffer’
does not match original declaration
[-Werror=lto-type-mismatch])
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
CC: dkm at gcc dot gnu.org
Target Milestone: ---
Bootstrapping with Ada fails when using -Werror=lto-type-mismatch -Werror=odr:
```
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/ada/fe.h:361:23:
error: type of ‘sinput__c_source_buffer’ does not match original declaration
[-Werror=lto-type-mismatch]
361 | extern struct c_array C_Source_Buffer (Source_File_Index);
| ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/ada/sinput.adb:283:4:
note: return value type mismatch
283 | function C_Source_Buffer (S : SFI) return C_Array is
| ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/ada/sinput.adb:283:4:
note: type ‘struct sinput__c_array’ should match type ‘struct c_array’
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/ada/fe.h:350:8:
note: the incompatible type is defined here
350 | struct c_array {
| ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/ada/sinput.adb:283:4:
note: ‘sinput__c_source_buffer’ was previously declared here
283 | function C_Source_Buffer (S : SFI) return C_Array is
| ^
/var/tmp/portage/sys-devel/gcc-15.0.9999/work/gcc-15.0.9999/gcc/ada/sinput.adb:283:4:
note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: some warnings being treated as errors
```
This seems to have regressed with yesterday's Ada patches.