This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid global optimize flag checks in LTO
- From: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org,Jan Hubicka <hubicka at ucw dot cz>
- Date: Fri, 07 Jul 2017 19:52:44 +0200
- Subject: Re: Avoid global optimize flag checks in LTO
- Authentication-results: sourceware.org; auth=none
- References: <20170707133154.GB71260@kam.mff.cuni.cz>
On 7 July 2017 15:31:55 CEST, Jan Hubicka <hubicka@ucw.cz> wrote:
>Hi,
>this patch fixes some places where we check global optimize flag rather
>than
>doing it per-function. This makes optimization attribute work closer to
>what one gets when passing the same flag at command line.
>This requires to run IPA passes even with !optimize, but having fast
>way through
>which does mostly nothing except when it sees functions with optimize
>attributes
>set.
Sounds gross.
>
>Bootstrapped/regtested x86_64-linux, comitted.
>
>Index: ipa-visibility.c
>===================================================================
>--- ipa-visibility.c (revision 250021)
>+++ ipa-visibility.c (working copy)
>@@ -622,9 +622,12 @@ function_and_variable_visibility (bool w
> int flags = flags_from_decl_or_type (node->decl);
>
> /* Optimize away PURE and CONST constructors and destructors. */
>- if (optimize
>+ if (node->analyzed
>+ && (DECL_STATIC_CONSTRUCTOR (node->decl)
>+ || DECL_STATIC_CONSTRUCTOR (node->decl))
Typo DECL_STATIC_DESTRUCTOR
thanks,