[Ada] Add special bypass for obsolete code pattern

Programming / Compilers / GCC - pmderodat [138bc75d-0d04-0410-961f-82ee72b054a4] - 12 August 2019 08:58 EDT

This change prevents the analysis phase of the front-end from setting the Do_Range_Check flag in the very peculiar case of the source of a conversion whose result is passed by reference to a "valued procedure", because the expansion phase would not be able to generate the check.

This pattern appears in the ancient DEC Starlet package and it doesn't seem to be useful at this point to change the expander to deal with it, so instead the analysis phase is adjusted. Morever the compiler already issues a warning in this case so this is probably good enough.

2019-08-12 Eric Botcazou

gcc/ada/

- sem_res.adb: Add with & use clause for Sem_Mech and alphabetize. (Resolve_Actuals): Do not apply a scalar range check for the source of a conversion whose result is passed by reference to a
valued procedure.

a8bcbb37b98 [Ada] Add special bypass for obsolete code pattern
gcc/ada/ChangeLog | 8 ++++++++
gcc/ada/sem_res.adb | 26 +++++++++++++++++++-------
2 files changed, 27 insertions(+), 7 deletions(-)

Upstream: gcc.gnu.org


  • Share