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/99596] [11 Regression] arm: internal error in single_pred_edge
Date: Fri, 16 Apr 2021 11:38:19 +0000	[thread overview]
Message-ID: <bug-99596-4-0aMIsS2BTz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99596-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

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

commit r11-8213-gb4d6af55fe55c0eab87ab875bfd0346677e12236
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Fri Apr 16 12:38:01 2021 +0100

    rtlanal: Don't assume that calls write to a global SP [PR99596]

    This patch is a GCC 11 regression caused by the rtl-ssa code.
    Normally we treat calls as containing a potential set of a global
    register, but DF makes a sensible exception for the stack pointer:

          if (i == STACK_POINTER_REGNUM)
            /* The stack ptr is used (honorarily) by a CALL insn.  */
            df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
                           NULL, bb, insn_info, DF_REF_REG_USE,
                           DF_REF_CALL_STACK_USAGE | flags);
          else if (global_regs[i])
            {
              /* Calls to const functions cannot access any global registers
and
                 calls to pure functions cannot set them.  All other calls may
                 reference any of the global registers, so they are recorded as
                 used. */

    The only DF definition of SP was therefore the one in the entry block.
    However, the rtlanal.c rtx_properties code (wrongly) assumed that calls
    also clobbered the global SP.  This led to multiple definitions of SP
    when we only expected one.

    This patch tightens the rtlanal.c handling of global registers
    to match the DF approach.

    gcc/
            PR rtl-optimization/99596
            * rtlanal.c (rtx_properties::try_to_add_insn): Don't add global
            register accesses for const calls.  Assume that pure functions
            can only read from global registers.  Ignore cases in which
            the stack pointer has been marked global.

    gcc/testsuite/
            PR rtl-optimization/99596
            * gcc.target/arm/pr99596.c: New test.

  parent reply	other threads:[~2021-04-16 11:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 11:46 [Bug target/99596] New: " arnd at linaro dot org
2021-03-15 11:57 ` [Bug target/99596] [11 Regression] " acoplan at gcc dot gnu.org
2021-03-15 12:27 ` rsandifo at gcc dot gnu.org
2021-04-08 13:06 ` [Bug rtl-optimization/99596] " rguenth at gcc dot gnu.org
2021-04-12 14:18 ` rguenth at gcc dot gnu.org
2021-04-16 11:38 ` cvs-commit at gcc dot gnu.org [this message]
2021-04-16 11:41 ` 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-99596-4-0aMIsS2BTz@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).