aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-05-15 08:27:44 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-05-15 08:27:44 +0000
commit0c09a01e9ea0608df0ae6754f67d630c1e40bb04 (patch)
tree4c9ba6b6fbac20d5aef34f719eac44d35b061cc7 /gcc/ada/gcc-interface/utils.c
parentb1b2b511e525b098204c590b0eafa7d36092b7e1 (diff)
downloadgcc-0c09a01e9ea0608df0ae6754f67d630c1e40bb04.zip
gcc-0c09a01e9ea0608df0ae6754f67d630c1e40bb04.tar.gz
gcc-0c09a01e9ea0608df0ae6754f67d630c1e40bb04.tar.bz2
trans.c (Compilation_Unit_to_gnu): Skip subprograms on the inlined list that are not public.
* gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on the inlined list that are not public. * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if there is a pragma Inline_Always on the subprogram. From-SVN: r248051
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 4fabddf..345b8a4 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -3220,10 +3220,19 @@ create_subprog_decl (tree name, tree asm_name, tree type, tree param_decl_list,
case is_required:
if (Back_End_Inlining)
- decl_attributes (&subprog_decl,
- tree_cons (get_identifier ("always_inline"),
- NULL_TREE, NULL_TREE),
- ATTR_FLAG_TYPE_IN_PLACE);
+ {
+ decl_attributes (&subprog_decl,
+ tree_cons (get_identifier ("always_inline"),
+ NULL_TREE, NULL_TREE),
+ ATTR_FLAG_TYPE_IN_PLACE);
+
+ /* Inline_Always guarantees that every direct call is inlined and
+ that there is no indirect reference to the subprogram, so the
+ instance in the original package (as well as its clones in the
+ client packages created for inter-unit inlining) can be made
+ private, which causes the out-of-line body to be eliminated. */
+ TREE_PUBLIC (subprog_decl) = 0;
+ }
/* ... fall through ... */