diff options
author | Javier Miranda <miranda@adacore.com> | 2019-12-13 09:05:08 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-12-13 09:05:08 +0000 |
commit | 3af796b550ebadbdba31dccea948b52fad7287dc (patch) | |
tree | 11df528c8b20ca713483565b7ab534cbe4c10229 /gcc/ada/exp_unst.adb | |
parent | 48f05f09e6791abe2080466f968c2cc27c401028 (diff) | |
download | gcc-3af796b550ebadbdba31dccea948b52fad7287dc.zip gcc-3af796b550ebadbdba31dccea948b52fad7287dc.tar.gz gcc-3af796b550ebadbdba31dccea948b52fad7287dc.tar.bz2 |
[Ada] Adding support for unsupported type conversions in CCG
2019-12-13 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_unst.adb (Unnest_Subprogram): Generate an extra temporary
to facilitate the C backend processing dereferences.
From-SVN: r279361
Diffstat (limited to 'gcc/ada/exp_unst.adb')
-rw-r--r-- | gcc/ada/exp_unst.adb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 5347a7f..f016d2f 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -27,6 +27,7 @@ with Atree; use Atree; with Debug; use Debug; with Einfo; use Einfo; with Elists; use Elists; +with Exp_Util; use Exp_Util; with Lib; use Lib; with Namet; use Namet; with Nlists; use Nlists; @@ -2345,6 +2346,18 @@ package body Exp_Unst is -- expect any exceptions) Analyze_And_Resolve (UPJ.Ref, Typ, Suppress => All_Checks); + + -- Generate an extra temporary to facilitate the C backend + -- processing this dereference + + if Opt.Modify_Tree_For_C + and then Nkind_In (Parent (UPJ.Ref), + N_Type_Conversion, + N_Unchecked_Type_Conversion) + then + Force_Evaluation (UPJ.Ref, Mode => Strict); + end if; + Pop_Scope; end Rewrite_One_Ref; end; |