]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix internal error on extension with interface at -O2
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 25 Jan 2021 10:27:29 +0000 (11:27 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 25 Jan 2021 10:40:00 +0000 (11:40 +0100)
commitbeebe1908fa7695615ff5237c6e9e2e46e866b14
tree136a139721a3e2834b89ee015ef544618d93ecfc
parent039ac05206397227b68436cd1572ac667820c915
Fix internal error on extension with interface at -O2

This is a regression present on the mainline, 10 and 9 branches, in the
form of an internal error with the Ada compiler when a covariant-only
thunk is inlined into its caller.

gcc/ada/
* gcc-interface/trans.c (make_covariant_thunk): Set the DECL_CONTEXT
of the parameters and do not set TREE_PUBLIC on the thunk.
(maybe_make_gnu_thunk): Pass the alias to the covariant thunk.
* gcc-interface/utils.c (finish_subprog_decl): Set the DECL_CONTEXT
of the parameters here...
(begin_subprog_body): ...instead of here.

gcc/testsuite/
* gnat.dg/thunk2.adb, gnat.dg/thunk2.ads: New test.
* gnat.dg/thunk2_pkg.ads: New helper.
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c
gcc/testsuite/gnat.dg/thunk2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/thunk2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/thunk2_pkg.ads [new file with mode: 0644]