gnu/gcc/e41707b1ff25dd152bc280dd9170313b2356d6a6 Ada: Fix run-time crash for imported C array declared without size
This is a regression introduced by a couple of recent unrelated changes,
which shows that adding an implicit indirection for large objects that
are declared at the library level may be problematic, especially when
they are intended to be part of an interface, e.g. to a foreign language.
Therefore, this changes the compiler to stop adding the indirection for
large objects subject to an aspect/pragma Export or Import. As a result,
the compiler or the linker will issue error messages for them.
gcc/ada/
* gcc-interface/decl.cc (allocatable_size_p): Add INTERFACE_P
parameter and return true for any fixed size when it is true.
(gnat_to_gnu_entity): Add EXPORTED_P local variable and use it
throughout.
<E_Variable>: Adjust calls to allocatable_size_p by passing true
for INTERFACE_P if the object is exported or imported. Remove
unreachable code giving a warning for too large imported objects.
1 file changed