public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/111411] [14 regression] ICE when building opus-1.4, unrecognizable insn with -fstack-protector-strong
Date: Thu, 14 Sep 2023 18:41:04 +0000	[thread overview]
Message-ID: <bug-111411-4-HZrvkpqDuo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111411-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
It's proving difficult to generate a reliable reproducer from
pure C code, due to the ways in which we handle out-of-range
offsets.  But FWIW, here's one that uses the RTL frontend,
compiled with -O -fdisable-rtl-postreload -fpeephole2:

extern int data[];

void __RTL (startwith ("ira")) foo (void *ptr)
{
  (function "foo"
    (param "ptr"
      (DECL_RTL (reg/v:DI <0> [ ptr ]))
      (DECL_RTL_INCOMING (reg/v:DI x0 [ ptr ]))
    ) ;; param "ptr"
    (insn-chain
      (block 2
        (edge-from entry (flags "FALLTHRU"))
        (cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK)
        (insn 4 (set (reg:DI <0>) (reg:DI x0)))
        (insn 5 (set (reg:DI <1>)
                     (plus:DI (reg:DI <0>) (const_int 768))))
        (insn 6 (set (mem:SI (plus:DI (reg:DI <0>)
                                      (const_int 508)) [1 &data+508 S4 A4])
                     (const_int 0)))
        (insn 7 (set (mem:SI (plus:DI (reg:DI <1>)
                                      (const_int -256)) [1 &data+512 S4 A4])
                     (const_int 0)))
        (edge-to exit (flags "FALLTHRU"))
      ) ;; block 2
    ) ;; insn-chain
  ) ;; function
}

(This one doesn't rely on -fstack-protector-strong, or on the recent
patches.)

The problem is that the LDP/STP formation code is too loose in the
check for valid addresses: it thinks it's enough for the second address
to be valid, even though that's not the one used in the STP.

  parent reply	other threads:[~2023-09-14 18:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14  3:07 [Bug target/111411] New: [14 regression] ICE when building opus-1.4 (celt_decoder.c:1182:1: internal compiler error: in extract_insn, at recog.cc:2791) sjames at gcc dot gnu.org
2023-09-14  3:30 ` [Bug target/111411] " pinskia at gcc dot gnu.org
2023-09-14  3:31 ` [Bug target/111411] [14 regression] ICE when building opus-1.4, unrecognizable insn with -fstack-protector-strong pinskia at gcc dot gnu.org
2023-09-14  5:15 ` sjames at gcc dot gnu.org
2023-09-14 14:45 ` pinskia at gcc dot gnu.org
2023-09-14 15:07 ` rsandifo at gcc dot gnu.org
2023-09-14 16:33 ` sjames at gcc dot gnu.org
2023-09-14 17:34 ` rsandifo at gcc dot gnu.org
2023-09-14 18:41 ` rsandifo at gcc dot gnu.org [this message]
2023-09-14 18:41 ` rsandifo at gcc dot gnu.org
2023-09-15  8:19 ` cvs-commit at gcc dot gnu.org
2023-09-15  8:22 ` rsandifo at gcc dot gnu.org
2023-09-15  9:28 ` Martin.Jansa at gmail dot com
2023-09-15  9:28 ` Martin.Jansa at gmail dot com
2023-09-20 10:08 ` cvs-commit at gcc dot gnu.org
2023-09-20 10:13 ` cvs-commit at gcc dot gnu.org
2023-09-20 10:53 ` rsandifo at gcc dot gnu.org
2023-10-05 17:22 ` pinskia 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-111411-4-HZrvkpqDuo@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).