public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133
@ 2024-01-03 17:04 mjires at suse dot cz
  2024-01-03 17:14 ` [Bug target/113220] " rsandifo at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mjires at suse dot cz @ 2024-01-03 17:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113220
           Summary: [aarch64] ICE Segmentation fault with
                    r14-6178-g8d29b7aca15133
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mjires at suse dot cz
                CC: richard.sandiford at arm dot com
  Target Milestone: ---
            Target: aarch64

Compiling reduced testcase gcc.target/aarch64/sme/zt0_state_5.c results in ICE
with r14-6178-g8d29b7aca15133.

$ cat zt0_state_5.c
#pragma GCC target "+sme2"
void inout_zt0() __arm_inout("zt0") {
  int ptr;
  ptr += 1;
}


$ aarch64-linux-gnu-gcc zt0_state_5.c -ftrapv -fstack-clash-protection
during RTL pass: mode_sw
zt0_state_5.c: In function ‘inout_zt0’:
zt0_state_5.c:5:1: internal compiler error: Segmentation fault
    5 | }
      | ^
0x1787d3a crash_signal
        /home/mjires/git/GCC/master/gcc/toplev.cc:316
0x16f07c8 rtx_properties::try_to_add_pattern(rtx_def const*)
        /home/mjires/git/GCC/master/gcc/rtlanal.cc:2246
0x16f0d4b rtx_properties::try_to_add_insn(rtx_insn const*, bool)
        /home/mjires/git/GCC/master/gcc/rtlanal.cc:2356
0x1c83f7b growing_rtx_properties<vec_rtx_properties_base>::add_insn(rtx_insn
const*, bool)::{lambda()#1}::operator()() const
        /home/mjires/git/GCC/master/gcc/rtlanal.h:288
0x1c866a2 void
growing_rtx_properties<vec_rtx_properties_base>::repeat<growing_rtx_properties<vec_rtx_properties_base>::add_insn(rtx_insn
const*,
bool)::{lambda()#1}>(growing_rtx_properties<vec_rtx_properties_base>::add_insn(rtx_insn
const*, bool)::{lambda()#1})
        /home/mjires/git/GCC/master/gcc/rtlanal.h:246
0x1c83fda growing_rtx_properties<vec_rtx_properties_base>::add_insn(rtx_insn
const*, bool)
        /home/mjires/git/GCC/master/gcc/rtlanal.h:288
0x1c79afe aarch64_mode_emit
        /home/mjires/git/GCC/master/gcc/config/aarch64/aarch64.cc:29400
0x2b318d1 optimize_mode_switching
        /home/mjires/git/GCC/master/gcc/mode-switching.cc:1210
0x2b31b7a execute
        /home/mjires/git/GCC/master/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.


$ aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/aarch64-linux-gnu/14.0.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --target=aarch64-linux-gnu
--disable-bootstrap --enable-languages=c,c++,fortran --disable-multilib
--disable-libsanitizer --enable-checking : (reconfigured)
/home/mjires/git/GCC/master/configure --prefix=/home/mjires/built/master
--target=aarch64-linux-gnu --disable-bootstrap --enable-languages=c,c++,fortran
--disable-multilib --disable-libsanitizer --enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240103 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/113220] [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133
  2024-01-03 17:04 [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133 mjires at suse dot cz
@ 2024-01-03 17:14 ` rsandifo at gcc dot gnu.org
  2024-01-26  5:23 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-01-03 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Sandiford <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|richard.sandiford at arm dot com   |rsandifo at gcc dot gnu.org
   Last reconfirmed|                            |2024-01-03
           Assignee|unassigned at gcc dot gnu.org      |rsandifo at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
Mine

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/113220] [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133
  2024-01-03 17:04 [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133 mjires at suse dot cz
  2024-01-03 17:14 ` [Bug target/113220] " rsandifo at gcc dot gnu.org
@ 2024-01-26  5:23 ` pinskia at gcc dot gnu.org
  2024-02-20 14:41 ` rsandifo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-26  5:23 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2024-01-03 00:00:00         |2024-1-25

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note you can also reproduce the failure with `-fstack-clash-protection` and
this simplified testcase:
```
#pragma GCC target "+sme2"
void inout_zt0() __arm_inout("zt0") {
  __builtin_abort();
}
```

Basically any noreturn function and -fstack-clash-protection and SME2 will
cause the ICE.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/113220] [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133
  2024-01-03 17:04 [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133 mjires at suse dot cz
  2024-01-03 17:14 ` [Bug target/113220] " rsandifo at gcc dot gnu.org
  2024-01-26  5:23 ` pinskia at gcc dot gnu.org
@ 2024-02-20 14:41 ` rsandifo at gcc dot gnu.org
  2024-02-21 11:12 ` cvs-commit at gcc dot gnu.org
  2024-02-21 11:16 ` rsandifo at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-02-20 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Sandiford <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zsojka at seznam dot cz

--- Comment #3 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
*** Bug 113778 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/113220] [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133
  2024-01-03 17:04 [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133 mjires at suse dot cz
                   ` (2 preceding siblings ...)
  2024-02-20 14:41 ` rsandifo at gcc dot gnu.org
@ 2024-02-21 11:12 ` cvs-commit at gcc dot gnu.org
  2024-02-21 11:16 ` rsandifo at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-21 11:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:4f7d4a2cd26673887f45e994a2f367a5c8fcc691

commit r14-9097-g4f7d4a2cd26673887f45e994a2f367a5c8fcc691
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Wed Feb 21 11:12:26 2024 +0000

    Allow mode-switching to introduce internal loops [PR113220]

    In this PR, the SME mode-switching code needs to insert a stack-probe
    loop for an alloca.  This patch allows the target to do that.

    There are two parts to it: allowing loops for insertions in blocks,
    and allowing them for insertions on edges.  The former can be handled
    entirely within mode-switching itself, by recording which blocks have
    had new branches inserted.  The latter requires an extension to
    commit_one_edge_insertion.

    I think the extension to commit_one_edge_insertion makes logical sense,
    since it already explicitly allows internal loops during RTL expansion.
    The single-block find_sub_basic_blocks is a relatively recent addition,
    so wouldn't have been available when the code was originally written.

    The patch also has a small and obvious fix to make the aarch64 emit
    hook cope with labels.

    I've added specific -fstack-clash-protection versions of all
    aarch64-sme.exp tests that previously failed because of this bug.
    I've also added -fno-stack-clash-protection to the original versions
    of these tests if they contain scans that assume no protection.

    gcc/
            PR target/113220
            * cfgrtl.cc (commit_one_edge_insertion): Handle sequences that
            contain jumps even if called after initial RTL expansion.
            * mode-switching.cc: Include cfgbuild.h.
            (optimize_mode_switching): Allow the sequence returned by the
            emit hook to contain internal jumps.  Record which blocks
            contain such jumps and split the blocks at the end.
            * config/aarch64/aarch64.cc (aarch64_mode_emit): Check for
            non-debug insns when scanning the sequence.

    gcc/testsuite/
            PR target/113220
            * gcc.target/aarch64/sme/call_sm_switch_5.c: Add
            -fno-stack-clash-protection.
            * gcc.target/aarch64/sme/call_sm_switch_5_scp.c: New test.
            * gcc.target/aarch64/sme/sibcall_6_scp.c: New test.
            * gcc.target/aarch64/sme/za_state_4.c: Add
            -fno-stack-clash-protection.
            * gcc.target/aarch64/sme/za_state_4_scp.c: New test.
            * gcc.target/aarch64/sme/za_state_5.c: Add
            -fno-stack-clash-protection.
            * gcc.target/aarch64/sme/za_state_5_scp.c: New test.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/113220] [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133
  2024-01-03 17:04 [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133 mjires at suse dot cz
                   ` (3 preceding siblings ...)
  2024-02-21 11:12 ` cvs-commit at gcc dot gnu.org
@ 2024-02-21 11:16 ` rsandifo at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-02-21 11:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Sandiford <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
Fixed

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-21 11:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 17:04 [Bug target/113220] New: [aarch64] ICE Segmentation fault with r14-6178-g8d29b7aca15133 mjires at suse dot cz
2024-01-03 17:14 ` [Bug target/113220] " rsandifo at gcc dot gnu.org
2024-01-26  5:23 ` pinskia at gcc dot gnu.org
2024-02-20 14:41 ` rsandifo at gcc dot gnu.org
2024-02-21 11:12 ` cvs-commit at gcc dot gnu.org
2024-02-21 11:16 ` rsandifo at gcc dot gnu.org

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).