From patchwork Sun Dec 8 13:53:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1205677 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515448-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="labzoiu9"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47W77w1fl7z9sP6 for ; Mon, 9 Dec 2019 00:53:13 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=RALJZS84tesMBmD1oyiWoSsx/lUdafm0gN131aXXCjys7yxfjVwFJ /KMS/KTWwb4LIICR1k3Og+CyxsJaMOzpuaoLfJEEYmRu/PZyfJHUP/bDx/5Js7mX KQbFuwBAr111w3jti3VsdMM+Mu8o1sNghLmzfo1Kjs7AjAM0uR+TMg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=Focht4Ut8p/Fu9ew11vh3/jcYXc=; b=labzoiu9BIV3pY5oMmJI o0VPQWa594Ppnjgl1I2YWzXl/W9AivktVXau5+FOGExz+EDl8Q7ZspZ6M2u4jylm U92m2Y5VJyXG5RWnXHuAPfRAjykZZbE4dZ8AhW2GsSKOg85/0g4aS3kMUmXTIypU svtnocqTh3rfzk+qDdtEuZs= Received: (qmail 57054 invoked by alias); 8 Dec 2019 13:53:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 57046 invoked by uid 89); 8 Dec 2019 13:53:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=Enum, wrt X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Dec 2019 13:53:05 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id C7F222805EF; Sun, 8 Dec 2019 14:53:02 +0100 (CET) Date: Sun, 8 Dec 2019 14:53:02 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, mliska@suse.cz Subject: Fix flag_toplevel_reorder wrt optimize attribute Message-ID: <20191208135302.qxiezuzakojimj37@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, this is (very likely partial) fix for PR92860 where optimize attribute incorrectly rewrites flag_toplevel_reorder which we handle as global flag. In fact we support per-symbol toplevel reordering for a while so we only need to add the annotation. However we need to inspect all other flags implied by optimize that they have Optimization attribute on them. Also i think this should be backoported to release branches, but it breaks LTO streaming compaibility. Bootstrapped/regtested x86_64-linux, comitted. PR tree-optimization/92860 * common.opt (fprofile-reorder-functions, ftoplevel-reorder): Add Optimization flag. Index: common.opt =================================================================== --- common.opt (revision 279076) +++ common.opt (working copy) @@ -2181,7 +2181,7 @@ Common Report Var(profile_report) Report on consistency of profile. fprofile-reorder-functions -Common Report Var(flag_profile_reorder_functions) +Common Report Var(flag_profile_reorder_functions) Optimization Enable function reordering that improves code placement. fpatchable-function-entry= @@ -2586,7 +2586,7 @@ EnumValue Enum(tls_model) String(local-exec) Value(TLS_MODEL_LOCAL_EXEC) ftoplevel-reorder -Common Report Var(flag_toplevel_reorder) Init(2) +Common Report Var(flag_toplevel_reorder) Init(2) Optimization Reorder top level functions, variables, and asms. ftracer