public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-96535-4-5h2NS9H1c1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96535-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96535

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:fe9458c280dbd6e8b892db4ca3b64185049c376b

commit r11-2672-gfe9458c280dbd6e8b892db4ca3b64185049c376b
Author: Jakub Jelinek <jakub@redhat.com>
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 introduction of
    flag_cunroll_grow_size broke optimize attribute related to loop unrolling.
    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 only
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-loops
    or -funroll-all-loops, which means that if command line does include any 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 attribute
    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 those
    is not appropriate).  Similarly, rs6000_option_override_internal is called
    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 into
    finish_options which is invoked whenever the options are being finalized,
    and the rs6000 specific parts into the override_options_after_change hook
    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 cmdline
    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  <jakub@redhat.com>

            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_size,
            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.

  parent reply	other threads:[~2020-08-12 15:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-08 10:23 [Bug c++/96535] New: GCC 10 ignoring function __attribute__ optimize for all x86 danielhanchen at gmail dot com
2020-08-10  7:55 ` [Bug c++/96535] " crazylht at gmail dot com
2020-08-11 10:09 ` [Bug c++/96535] [10/11 Regression] GCC 10 ignoring function __attribute__ optimize for all x86 since r11-1019 jakub at gcc dot gnu.org
2020-08-11 10:22 ` danielhanchen at gmail dot com
2020-08-11 10:45 ` [Bug tree-optimization/96535] " jakub at gcc dot gnu.org
2020-08-11 10:45 ` jakub at gcc dot gnu.org
2020-08-11 11:28 ` marxin at gcc dot gnu.org
2020-08-11 13:36 ` jakub at gcc dot gnu.org
2020-08-11 14:04 ` guojiufu at gcc dot gnu.org
2020-08-12 15:02 ` cvs-commit at gcc dot gnu.org [this message]
2020-08-25 17:45 ` [Bug tree-optimization/96535] [10 " cvs-commit at gcc dot gnu.org
2020-08-25 18:24 ` jakub at gcc dot gnu.org

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=bug-96535-4-5h2NS9H1c1@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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: link
Be 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).