[Ada] Static expression function problems with -gnatc and -gnatd.F (SPARK mode)
gcc/ada/
* exp_ch6.adb (Expand_Simple_Function_Return): Remove ugly code
that was copying the return expression, resetting Analyzed
flags, etc. for the return expression of static expression
functions.
* inline.adb (Inline_Static_Expression_Function_Call): Set the
Parent of the copied expression to that of the call. This avoids
a blowup in Insert_Actions when GNATprove_Mode is set and there
are nested SEF calls. Add ??? comment.
* sem_ch6.adb (Analyze_Expression_Function): In the case of a
static expression function, create a new copy of the expression
and replace the function's expression with the copy; the
original expression is used in the expression function's body
and will be analyzed and rewritten, and we need to save a clean
copy for later use in processing static calls to the function.
This allows removing the kludgy code that was in
Expand_Simple_Function_Return.
* sem_eval.adb (Eval_Qualified_Expression): Return immediately
if any errors have been posted on the qualified expression, to
avoid blowups when GNATprove_Mode is enabled (or with -gnatd.F),
since illegal static expressions are handled differently in that
case and attempting to fold such expressions would fail.