diff options
author | Ed Schonberg <schonberg@adacore.com> | 2019-10-10 15:23:14 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-10-10 15:23:14 +0000 |
commit | 95a7982243dd1e589ed59007d36f36027a3412ef (patch) | |
tree | cd100061cf23ce28ab0005abcdc5020eed89efb4 /gcc | |
parent | 2f26abccd0f04f87e348cb0127cc24fc7265f06a (diff) | |
download | gcc-95a7982243dd1e589ed59007d36f36027a3412ef.zip gcc-95a7982243dd1e589ed59007d36f36027a3412ef.tar.gz gcc-95a7982243dd1e589ed59007d36f36027a3412ef.tar.bz2 |
[Ada] Spurious restriction violation on Ghost code
2019-10-10 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_ch6.adb (Expand_Simple_Function_Return_Statement): If the
function to which the return statement applies is an
Ignored_Ghost_Function, do not indicate that it uses the
secondary stack when the return type is unconstrained.
From-SVN: r276814
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/ada/exp_ch6.adb | 7 |
2 files changed, 11 insertions, 15 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 745c7b5..7579bb3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,15 +1,6 @@ -2019-10-10 Bob Duff <duff@adacore.com> +2019-10-10 Ed Schonberg <schonberg@adacore.com> - * libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, - libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, - libgnat/a-cborma.adb, libgnat/a-cborse.adb, - libgnat/a-cdlili.adb, libgnat/a-cidlli.adb, - libgnat/a-cihama.adb, libgnat/a-cihase.adb, - libgnat/a-cimutr.adb, libgnat/a-ciorma.adb, - libgnat/a-ciorse.adb, libgnat/a-cobove.adb, - libgnat/a-cohama.adb, libgnat/a-cohase.adb, - libgnat/a-coinve.adb, libgnat/a-comutr.adb, - libgnat/a-conhel.adb, libgnat/a-convec.adb, - libgnat/a-coorma.adb, libgnat/a-coorse.adb (Reference, - Constant_Reference): Use Busy instead of Lock, so we forbid - tampering with cursors, rather than tampering with elements.
\ No newline at end of file + * exp_ch6.adb (Expand_Simple_Function_Return_Statement): If the + function to which the return statement applies is an + Ignored_Ghost_Function, do not indicate that it uses the + secondary stack when the return type is unconstrained.
\ No newline at end of file diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index c569ca3..b311322 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -6895,7 +6895,12 @@ package body Exp_Ch6 is elsif Is_Thunk (Current_Scope) and then Is_Incomplete_Type (Exptyp) then return; - elsif not Requires_Transient_Scope (R_Type) then + -- A return statement from a Ghost function does not use the secondary + -- stack (or any other one). + + elsif not Requires_Transient_Scope (R_Type) + or else Is_Ignored_Ghost_Entity (Scope_Id) + then -- Mutable records with variable-length components are not returned -- on the sec-stack, so we need to make sure that the back end will |