public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113778] ICE: RTL check: expected elt 3 type 'e' or 'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1506 with -march=armv9-a+sme -fhardened
Date: Wed, 07 Feb 2024 13:21:12 +0000	[thread overview]
Message-ID: <bug-113778-4-N8ZX4rYBHy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113778-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Just -march=armv9-a+sme -fstack-clash-protection is needed.
early_ra::preprocess_insns as the only other user of vec_rtx_properties does:
  for (rtx_insn *insn = get_insns (); insn; insn = NEXT_INSN (insn))
    {
      if (!NONDEBUG_INSN_P (insn))
        continue;

      // Mark all registers that occur in addresses as needing a GPR.
      vec_rtx_properties properties;
      properties.add_insn (insn, true);
and I think only NONDEBUG_INSN_P can actually clobber anything (DEBUG_INSNs
can't and other rtx_insns don't even have a PATTERN).
But
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -29491,6 +29491,9 @@ aarch64_mode_emit (int entity, int mode, int prev_mode,
HARD_REG_SET live)
   HARD_REG_SET clobbers = {};
   for (rtx_insn *insn = seq; insn; insn = NEXT_INSN (insn))
     {
+      if (!NONDEBUG_INSN_P (insn))
+       continue;
+
       vec_rtx_properties properties;
       properties.add_insn (insn, false);
       for (rtx_obj_reference ref : properties.refs ())
doesn't actually fix this, we ICE elsewhere:
./cc1 -quiet -nostdinc pr113778.c -march=armv9-a+sme -fstack-clash-protection
during RTL pass: mode_sw
pr113778.c: In function ‘shared_to_normal’:
pr113778.c:2:65: internal compiler error: Segmentation fault
    2 | void shared_to_normal() [[arm::inout("za")]] { normal_callee(); }
      |                                                                 ^
0x171054c crash_signal
        ../../gcc/toplev.cc:317
0xfe7d1d rtl_verify_bb_pointers
        ../../gcc/cfgrtl.cc:2834
0xfe7ede rtl_verify_flow_info_1
        ../../gcc/cfgrtl.cc:2886
0xfe864a rtl_verify_flow_info
        ../../gcc/cfgrtl.cc:3134
0xfcdb08 verify_flow_info()
        ../../gcc/cfghooks.cc:283
0xfc4548 checking_verify_flow_info()
        ../../gcc/cfghooks.h:214
0x2a4dac5 try_optimize_cfg
        ../../gcc/cfgcleanup.cc:2980
0x2a4df9e cleanup_cfg(int)
        ../../gcc/cfgcleanup.cc:3143
0x2c02d0d optimize_mode_switching
        ../../gcc/mode-switching.cc:1261
0x2c02dee execute
        ../../gcc/mode-switching.cc:1309
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

mode switching isn't prepared for targetm.mode_switching.confluence to emit
labels that would need splitting the current bb (say using
find_sub_basic_blocks).
But, disabling -fstack-clash-protection temporarily in such sequences means it
will not act the way it is supposed to.

  parent reply	other threads:[~2024-02-07 13:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 21:05 [Bug tree-optimization/113778] New: " zsojka at seznam dot cz
2024-02-05 21:26 ` [Bug target/113778] " pinskia at gcc dot gnu.org
2024-02-07 13:21 ` jakub at gcc dot gnu.org [this message]
2024-02-15 20:26 ` rsandifo at gcc dot gnu.org
2024-02-20 14:41 ` rsandifo 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-113778-4-N8ZX4rYBHy@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).