public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/94119] [8/9/10 regression] invalid filling of branch delay slots leads to corrupt jump
Date: Fri, 13 Mar 2020 09:09:58 +0000	[thread overview]
Message-ID: <bug-94119-4-paNGxzwiN1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94119-4@http.gcc.gnu.org/bugzilla/>

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
commit r9-8372-g593e47a6134085e9b856c62f98f72acd4446ba7c
Author: Eric Botcazou <ebotcazou@gcc.gnu.org>
Date:   Fri Mar 13 09:58:44 2020 +0100

    Fix incorrect filling of delay slots in branchy code at -O2

    The issue is that relax_delay_slots can streamline the CFG in some cases,
    in particular remove BARRIERs, but removing BARRIERs changes the way the
    instructions are associated with (basic) blocks by the liveness analysis
    code in resource.c (find_basic_block) and thus can cause entries in the
    cache maintained by resource.c to become outdated, thus producing wrong
    answers downstream.

    The fix is to invalidate the cache entries affected by the removal of
    BARRIERs in relax_delay_slots, i.e. for the instructions down to the
    next BARRIER.

            PR rtl-optimization/94119
            * resource.h (clear_hashed_info_until_next_barrier): Declare.
            * resource.c (clear_hashed_info_until_next_barrier): New function.
            * reorg.c (add_to_delay_list): Fix formatting.
            (relax_delay_slots): Call clear_hashed_info_until_next_barrier on
            the next instruction after removing a BARRIER.

  parent reply	other threads:[~2020-03-13  9:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-10 10:44 [Bug c/94119] New: MIPS: Invalid use of branch delay slots leading " d.dorau at avm dot de
2020-03-11 13:47 ` [Bug rtl-optimization/94119] " ebotcazou at gcc dot gnu.org
2020-03-11 14:43 ` d.dorau at avm dot de
2020-03-11 16:27 ` ebotcazou at gcc dot gnu.org
2020-03-12  8:51 ` d.dorau at avm dot de
2020-03-12 11:31 ` [Bug rtl-optimization/94119] [8/9/10 regression] invalid filling of branch delay slots leads " ebotcazou at gcc dot gnu.org
2020-03-12 11:31 ` ebotcazou at gcc dot gnu.org
2020-03-13  9:09 ` marxin at gcc dot gnu.org [this message]
2020-03-13  9:10 ` marxin at gcc dot gnu.org
2020-03-13  9:12 ` marxin at gcc dot gnu.org
2020-03-13  9:14 ` ebotcazou at gcc dot gnu.org
2020-03-13 16:23 ` d.dorau at avm dot de
2020-03-13 17:06 ` ebotcazou 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-94119-4-paNGxzwiN1@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).