]> 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:27 +0000 (11:40 +0100)
commit73f957aab7ece81552465a3a07d402a414ddc57b
treee594049220da55f52aeeb39928b7360b64240bdd
parent504159b44da4adbea75047da0ad06c6d4223caec
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]