[Ada] Spurious visibility error in inlined function
Pierre-Marie de Rodat
derodat@adacore.com
Wed Jul 3 08:31:00 GMT 2019
This patch corrects the use of tree replication when inlining a function
that returns an unconstrained result, and its sole statement is an
extended return statement. The use of New_Copy_Tree ensires that global
references saved in a generic template are properly carried over when
the function is instantiated and inlined.
Tested on x86_64-pc-linux-gnu, committed on trunk
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* inline.adb (Build_Return_Object_Formal): New routine.
(Can_Split_Unconstrained_Function): Code clean up.
(Copy_Formals,Copy_Return_Object): New routines.
(Split_Unconstrained_Function): Code clean up and refactoring.
gcc/testsuite/
* gnat.dg/inline15.adb, gnat.dg/inline15_gen.adb,
gnat.dg/inline15_gen.ads, gnat.dg/inline15_types.ads: New
testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 17029 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190703/35f47e5f/attachment.bin>
More information about the Gcc-patches
mailing list