[Ada] Add special bypass for obsolete code pattern
commit4d7d2736587ecfb99b513645dda7460f9100f69c
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 12 Aug 2019 08:58:57 +0000 (12 08:58 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 12 Aug 2019 08:58:57 +0000 (12 08:58 +0000)
treefa7e14aea5b6d687c59bc5644db06520bf642baf
parent13931a38fcab143344c90378c3688d089a4efbec
[Ada] Add special bypass for obsolete code pattern

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  <ebotcazou@adacore.com>

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.

From-SVN: r274281
gcc/ada/ChangeLog
gcc/ada/sem_res.adb