[Ada] Spurious visibility error in inlined function

Programming / Compilers / GCC - pmderodat [138bc75d-0d04-0410-961f-82ee72b054a4] - 3 July 2019 08:15 EDT

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.

2019-07-03 Hristian Kirtchev

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.

d044ba5cd88 [Ada] Spurious visibility error in inlined function
gcc/ada/ChangeLog | 7 +
gcc/ada/inline.adb | 267 ++++++++++++++++++++-----------
gcc/testsuite/ChangeLog | 6 +
gcc/testsuite/gnat.dg/inline15.adb | 11 ++
gcc/testsuite/gnat.dg/inline15_gen.adb | 27 ++++
gcc/testsuite/gnat.dg/inline15_gen.ads | 11 ++
gcc/testsuite/gnat.dg/inline15_types.ads | 17 ++
7 files changed, 255 insertions(+), 91 deletions(-)

Upstream: gcc.gnu.org


  • Share