aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-08-13 08:06:39 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-13 08:06:39 +0000
commitd71e9fb2a5f1d55a065e3b50ee5fb2a34e75ead7 (patch)
treefbd2a073166c4fd599360c1c5d693860f419b9e4 /gcc/ada/gcc-interface
parent7225a4797180b6dc515760b0c123001cda2b66a2 (diff)
downloadgcc-d71e9fb2a5f1d55a065e3b50ee5fb2a34e75ead7.zip
gcc-d71e9fb2a5f1d55a065e3b50ee5fb2a34e75ead7.tar.gz
gcc-d71e9fb2a5f1d55a065e3b50ee5fb2a34e75ead7.tar.bz2
[Ada] Fix spurious error on nested instantiation with inlining
This prevents the compiler from issuing a spurious error in a convoluted case where a child generic package declared in an enclosing parent generic package, which contains a second child generic package, contains an inlined subprogram and the second child generic package contains an instantiation of the first, and the enclosing parent generic package is instantiated with inlining across units enabled (-gnatn[12]). The problem is that the compiler attempts to instantiate the body of the first child generic package in the context of the enclosing parent generic package, instead of doing it in the context of the instantiation of the parent generic package, because of the presence of the inlined subprogram. 2019-08-13 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): If back-end inlining is enabled, also instantiate the body of a generic unit containing a subprogram subject to aspect/pragma Inline_Always at optimization level zero. * sem_ch12.adb (Might_Inline_Subp): Minor tweak. (Analyze_Package_Instantiation): Do not instantiate the package body because of inlining considerations if the instantiation is done in a generic unit. Move around similar condition involving the main unit. Add test on Back_End_Inlining to processing for front-end inlining. gcc/testsuite/ * gnat.dg/generic_inst8.adb, gnat.dg/generic_inst8.ads, gnat.dg/generic_inst8_g.adb, gnat.dg/generic_inst8_g.ads: New testcase. From-SVN: r274336
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions