From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D5752384BC11; Wed, 12 Aug 2020 15:02:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5752384BC11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597244534; bh=gkrlHj/bCdg3tMmspZ9yS/k8I52W2hUimp2zKa89Imo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IvZe0F6dNpJae3rCdbEKf6gNL6xy0er5sQTdBwmklFQ9h3FaJZdsKIAORzLBXuzIr LnKmOYsKWJgR1N+6XxmFfGE7kddpbzJmvEs+/9qlhsO8gJi1Y6wrFy8y/DsX1xcw+i 2QpWZI1A+i16BEyE3cZzCXr4ukkXO8guGlZArzl8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/96535] [10/11 Regression] GCC 10 ignoring function __attribute__ optimize for all x86 since r11-1019 Date: Wed, 12 Aug 2020 15:02:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2020 15:02:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96535 --- Comment #9 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:fe9458c280dbd6e8b892db4ca3b64185049c376b commit r11-2672-gfe9458c280dbd6e8b892db4ca3b64185049c376b Author: Jakub Jelinek Date: Wed Aug 12 17:00:41 2020 +0200 Fix up flag_cunroll_grow_size handling in presence of optimize attr [PR96535] As the testcase in the PR shows (not included in the patch, as it seems quite fragile to observe unrolling in the IL), the introductio= n of flag_cunroll_grow_size broke optimize attribute related to loop unrolli= ng. The problem is that the new option flag is set (if not set explicitly) = only in process_options and in rs6000_option_override_internal (and there on= ly if global_init_p). So, this means that while it is Optimization option, it will only be set based on the command line -funroll-loops/-O3/-fpeel-lo= ops or -funroll-all-loops, which means that if command line does include an= y of those, it is enabled even for functions that will through optimize attribute have all of those disabled, and if command line does not include those, it will not be enabled for functions that will through optimize attribu= te have any of those enabled. process_options is called just once, so IMHO it should be handling only non-Optimization option adjustments (various other options suffer from = that too, but as this is a regression from 10.1 on the 10 branch, changing t= hose is not appropriate). Similarly, rs6000_option_override_internal is cal= led only once (with global_init_p) and then for target attribute handling, = but not for optimize attribute handling. This patch moves the unrolling related handling from process_options in= to finish_options which is invoked whenever the options are being finalize= d, and the rs6000 specific parts into the override_options_after_change ho= ok which is called for optimize attribute handling (and unfortunately also th cfun changes, but what the hook does is cheap) and I've added a call= to that from rs6000_override_options_internal, so it is also called on cmd= line processing and for target attribute. Furthermore, it stops using AUTODETECT_VALUE, which can work only once, and instead uses the global_options_set.x_... flags. 2020-08-12 Jakub Jelinek PR tree-optimization/96535 * toplev.c (process_options): Move flag_unroll_loops and flag_cunroll_grow_size handling from here to ... * opts.c (finish_options): ... here. For flag_cunroll_grow_siz= e, don't check for AUTODETECT_VALUE, but instead check opts_set->x_flag_cunroll_grow_size. * common.opt (funroll-completely-grow-size): Default to 0. * config/rs6000/rs6000.c (TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE): Redefine. (rs6000_override_options_after_change): New function. (rs6000_option_override_internal): Call it. Move there the flag_cunroll_grow_size, unroll_only_small_loops and flag_rename_registers handling.=