[Ada] Fix leak of Do_Range_Check flag in -gnatVa mode
This fixes a small glitch in Insert_Valid_Check, which needs to
propagate the Do_Range_Check flag onto the rewritten expression, but
uses its Original_Node as the source of the copy. Now Original_Node
does not necessarily point to the node that was just rewritten, but to
the ultimately original node, which is not the same node if the
expression was rewritten multiple times. The end result is that a
stalled Do_Range_Check flag can be wrongly resintated and leak to the
code generator.
2019-08-12 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* checks.adb (Insert_Valid_Check): Do not retrieve the
Do_Range_Check flag from the Original_Node but from the
Validated_Object. Remove useless bypass for floating-point
types.
gcc/testsuite/
* gnat.dg/range_check7.adb: New testcase.
From-SVN: r274285