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 rtl-optimization/94440] [8/9/10 Regression] ICE in check_bool_attrs, at recog.c:2168 since r7-5324-gb8cab8a5492e9639
Date: Wed, 06 Jan 2021 09:39:39 +0000	[thread overview]
Message-ID: <bug-94440-4-ByOQG5iysK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94440-4@http.gcc.gnu.org/bugzilla/>

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

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

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

commit r10-9218-ga9a0d654006df98dd2c29b907c83571819c49727
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Dec 8 15:44:10 2020 +0100

    i386: Fix up X87_ENABLE_{FLOAT,ARITH} in conditions [PR94440]

    The documentation says
         For a named pattern, the condition may not depend on the data in
         the insn being matched, but only the target-machine-type flags.
    The i386 backend violates that by using flag_excess_precision and
    flag_unsafe_math_optimizations in the conditions too, which is bad
    when optimize attribute or pragmas are used.  The problem is that the
    middle-end caches the enabled conditions for the optabs for a particular
    switchable target, but multiple functions can share the same
    TARGET_OPTION_NODE, but have different TREE_OPTIMIZATION_NODE with
different
    flag_excess_precision or flag_unsafe_math_optimizations, so the enabled
    conditions then match only one of those.

    I think best would be to just have a single options node for both the
    generic and target options, then such problems wouldn't exist, but that
    would be very risky at this point and quite large change.

    So, instead the following patch just shadows flag_excess_precision and
    flag_unsafe_math_optimizations values for uses in the instruction
conditions
    in TargetVariable and during set_cfun artificially creates new
    TARGET_OPTION_NODE if flag_excess_precision and/or
    flag_unsafe_math_optimizations change from what is recorded in their
    TARGET_OPTION_NODE.  The target nodes are hashed, so worst case we can get
4
    times as many target option nodes if one would for each unique target
option
    try all the flag_excess_precision and flag_unsafe_math_optimizations
values.

    2020-12-08  Jakub Jelinek  <jakub@redhat.com>

            PR target/94440
            * config/i386/i386.opt (ix86_excess_precision,
            ix86_unsafe_math_optimizations): New TargetVariables.
            * config/i386/i386.h (X87_ENABLE_ARITH, X87_ENABLE_FLOAT): Use
            ix86_unsafe_math_optimizations instead of
            flag_unsafe_math_optimizations and ix86_excess_precision instead of
            flag_excess_precision.
            * config/i386/i386.c (ix86_excess_precision): Rename to ...
            (ix86_get_excess_precision): ... this.
            (TARGET_C_EXCESS_PRECISION): Define to ix86_get_excess_precision.
            * config/i386/i386-options.c (ix86_valid_target_attribute_tree,
            ix86_option_override_internal): Update
ix86_unsafe_math_optimization
            from flag_unsafe_math_optimizations and ix86_excess_precision
            from flag_excess_precision when constructing target option nodes.
            (ix86_set_current_function): If flag_unsafe_math_optimizations
            or flag_excess_precision is different from the one recorded
            in TARGET_OPTION_NODE, create a new target option node for the
            current function and switch to that.

    (cherry picked from commit e401db7bfd8cf86d3833805a81b1252884eb1c9d)

  parent reply	other threads:[~2021-01-06  9:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 12:47 [Bug rtl-optimization/94440] New: " marxin at gcc dot gnu.org
2020-04-01 12:47 ` [Bug rtl-optimization/94440] " marxin at gcc dot gnu.org
2020-04-01 13:02 ` rguenth at gcc dot gnu.org
2020-04-01 13:23 ` ubizjak at gmail dot com
2020-04-01 13:38 ` jakub at gcc dot gnu.org
2020-04-01 14:05 ` jakub at gcc dot gnu.org
2020-04-01 14:07 ` ubizjak at gmail dot com
2020-04-01 14:09 ` marxin at gcc dot gnu.org
2020-04-01 14:21 ` jakub at gcc dot gnu.org
2020-04-18 16:28 ` law at redhat dot com
2020-07-30 15:42 ` [Bug rtl-optimization/94440] [8/9/10/11 " dcb314 at hotmail dot com
2020-10-09  7:12 ` dcb314 at hotmail dot com
2020-12-07 10:15 ` dcb314 at hotmail dot com
2020-12-07 12:38 ` jakub at gcc dot gnu.org
2020-12-07 12:56 ` dcb314 at hotmail dot com
2020-12-07 13:04 ` marxin at gcc dot gnu.org
2020-12-07 13:28 ` hjl.tools at gmail dot com
2020-12-07 14:06 ` jakub at gcc dot gnu.org
2020-12-07 16:48 ` jakub at gcc dot gnu.org
2020-12-08 14:44 ` cvs-commit at gcc dot gnu.org
2021-01-06  9:39 ` cvs-commit at gcc dot gnu.org [this message]
2021-01-06  9:45 ` [Bug rtl-optimization/94440] [8/9 " jakub at gcc dot gnu.org
2021-04-27 11:38 ` jakub at gcc dot gnu.org
2021-07-28  7:04 ` [Bug rtl-optimization/94440] [9 " rguenth at gcc dot gnu.org
2022-01-05 19:18 ` ubizjak at gmail dot com
2022-04-21  7:47 ` rguenth at gcc dot gnu.org
2023-05-29 10:02 ` 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-94440-4-ByOQG5iysK@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).