public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-635] [Ada] Do not override inlining heuristics for expression functions at -Os Date: Thu, 19 May 2022 14:06:23 +0000 (GMT) [thread overview] Message-ID: <20220519140623.BC74B383F425@sourceware.org> (raw) https://gcc.gnu.org/g:3b0cd3f02ed6c151aacb50364222566bef29e72f commit r13-635-g3b0cd3f02ed6c151aacb50364222566bef29e72f Author: Eric Botcazou <ebotcazou@adacore.com> Date: Thu Jan 27 17:18:28 2022 +0100 [Ada] Do not override inlining heuristics for expression functions at -Os gcc/ada/ * gcc-interface/trans.cc (Subprogram_Body_to_gnu): Do not deal with inlining heuristics for expression functions here but... * gcc-interface/decl.cc (inline_status_for_subprog): ...here instead and do not override them at -Os. Diff: --- gcc/ada/gcc-interface/decl.cc | 9 ++++++++- gcc/ada/gcc-interface/trans.cc | 7 +------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index aae1ef10509..e6f2df8f1ab 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2021, Free Software Foundation, Inc. * + * Copyright (C) 1992-2022, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -5037,6 +5037,13 @@ inline_status_for_subprog (Entity_Id subprog) && compare_tree_int (TYPE_SIZE (gnu_type), MAX_FIXED_MODE_SIZE) <= 0) return is_prescribed; + /* If this is an expression function and we're not optimizing for size, + override the heuristics, unless -gnatd.8 is specified. */ + if (Is_Expression_Function (subprog) + && !optimize_size + && !Debug_Flag_Dot_8) + return is_prescribed; + return is_requested; } diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc index e9701cdf72f..67c69b020c5 100644 --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2021, Free Software Foundation, Inc. * + * Copyright (C) 1992-2022, Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -3906,11 +3906,6 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) locus = input_location; DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus; - /* If the body comes from an expression function, arrange it to be inlined - in almost all cases. */ - if (Was_Expression_Function (gnat_node) && !Debug_Flag_Dot_8) - DECL_DISREGARD_INLINE_LIMITS (gnu_subprog_decl) = 1; - /* Try to create a bona-fide thunk and hand it over to the middle-end. */ if (Is_Thunk (gnat_subprog_id) && maybe_make_gnu_thunk (gnat_subprog_id, gnu_subprog_decl))
reply other threads:[~2022-05-19 14:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220519140623.BC74B383F425@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).