public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/112567] New: [14 regression] ICE in  RTL pass: split2: Segmentation fault
@ 2023-11-16 12:39 slyfox at gcc dot gnu.org
  2023-11-16 12:44 ` [Bug target/112567] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-11-16 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112567
           Summary: [14 regression] ICE in  RTL pass: split2: Segmentation
                    fault
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed ICE when was building linux-6.6.1 with gcc-master at
r14-5529-g7a496b7ce10518

cvise came up with the following trigger:

// $ cat ast_mode.c.c
union { char b[4]; void (*ul)(void); } gu;
int gv;

void writew(...);

void bug(void) {
  struct { char b[2]; } s;

  gu.ul = bug;
  s.b[0] = gu.b[1] | gv;
  writew(s);
}

Crashes as:

$ gcc -O1  -c ast_mode.c.c -o a.o
during RTL pass: split2
ast_mode.c.c: In function 'bug':
ast_mode.c.c:12:1: internal compiler error: Segmentation fault
   12 | }
      | ^
0x103e83f crash_signal
        ../../source/gcc/toplev.cc:316
0xbd5d7b mark_label_nuses
        ../../source/gcc/emit-rtl.cc:3755
0xbd5dcc mark_label_nuses
        ../../source/gcc/emit-rtl.cc:3763
0xbd5dcc mark_label_nuses
        ../../source/gcc/emit-rtl.cc:3763
0xbd5ded mark_label_nuses
        ../../source/gcc/emit-rtl.cc:3766
0xbda6e6 try_split(rtx_def*, rtx_insn*, int)
        ../../source/gcc/emit-rtl.cc:3952
0xf929d7 split_insn
        ../../source/gcc/recog.cc:3383
0xf981c7 split_all_insns()
        ../../source/gcc/recog.cc:3487
0xf98278 execute
        ../../source/gcc/recog.cc:4411

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer --enable-languages=c
CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0' : (reconfigured)
/home/slyfox/dev/git/gcc/configure --disable-multilib --disable-bootstrap
--disable-lto --disable-libsanitizer --enable-languages=c CFLAGS='-O1 -g0'
CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231116 (experimental) (GCC)

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

* [Bug target/112567] [14 regression] ICE in  RTL pass: split2: Segmentation fault
  2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
@ 2023-11-16 12:44 ` rguenth at gcc dot gnu.org
  2023-11-16 13:10 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-16 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
           Keywords|                            |ice-on-valid-code,
                   |                            |needs-bisection
             Target|                            |x86_64-*-*

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

* [Bug target/112567] [14 regression] ICE in  RTL pass: split2: Segmentation fault
  2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
  2023-11-16 12:44 ` [Bug target/112567] " rguenth at gcc dot gnu.org
@ 2023-11-16 13:10 ` ubizjak at gmail dot com
  2023-11-16 14:05 ` dcb314 at hotmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2023-11-16 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-11-16
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Mine, due to [1], this time I managed to split to invalid RTX...

I have a patch.

[1] https://gcc.gnu.org/pipermail/gcc-cvs/2023-November/393104.html

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

* [Bug target/112567] [14 regression] ICE in  RTL pass: split2: Segmentation fault
  2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
  2023-11-16 12:44 ` [Bug target/112567] " rguenth at gcc dot gnu.org
  2023-11-16 13:10 ` ubizjak at gmail dot com
@ 2023-11-16 14:05 ` dcb314 at hotmail dot com
  2023-11-16 15:59 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dcb314 at hotmail dot com @ 2023-11-16 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
I get the same for this C++ code:

struct {
  long length();
} fromBase32Hex_input;
int set_bits_start, set_bits_length;
char fromBase32Hex_block[1];
char fromBase32Hex_cr;
void fromBase32Hex() {
  for (; fromBase32Hex_input.length();) {
    char *s = fromBase32Hex_block;
    char cc = set_bits_length >> 8;
    if (set_bits_length) {
      s[set_bits_start / 8] |= cc;
      s[set_bits_start / 8 + 1] |= fromBase32Hex_cr;
    }
    s[set_bits_start / 8] |= fromBase32Hex_cr;
  }
}

cvise $ ~/gcc/results/bin/gcc -c -w -O2  bug982.cc
cvise $ ~/gcc/results/bin/gcc -c -w -O2 -march=znver1 bug982.cc
during RTL pass: split2
bug982.cc: In function ‘void fromBase32Hex()’:
bug982.cc:17:1: internal compiler error: Segmentation fault
   17 | }
      | ^
0x11b6759 crash_signal(int)
        ../../trunk.year/gcc/toplev.cc:316
0xcc7899 mark_label_nuses(rtx_def*)
        ../../trunk.year/gcc/emit-rtl.cc:3750

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

* [Bug target/112567] [14 regression] ICE in  RTL pass: split2: Segmentation fault
  2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-11-16 14:05 ` dcb314 at hotmail dot com
@ 2023-11-16 15:59 ` cvs-commit at gcc dot gnu.org
  2023-11-16 16:03 ` ubizjak at gmail dot com
  2023-11-16 19:15 ` slyfox at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-16 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:06ff410e0dea135d41bc5f7a9a007d7ba6822dbf

commit r14-5533-g06ff410e0dea135d41bc5f7a9a007d7ba6822dbf
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Thu Nov 16 16:48:07 2023 +0100

    i386: Fix invalid RTX in split2 pass [PR112567]

    Also fix some indentitation inconsistencies.

            PR target/112567

    gcc/ChangeLog:

            * config/i386/i386.md (*<any_logic:code>qi_ext<mode>_1_slp):
            Fix generation of invalid RTX in split pattern.

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

* [Bug target/112567] [14 regression] ICE in  RTL pass: split2: Segmentation fault
  2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-11-16 15:59 ` cvs-commit at gcc dot gnu.org
@ 2023-11-16 16:03 ` ubizjak at gmail dot com
  2023-11-16 19:15 ` slyfox at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2023-11-16 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

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

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed.

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

* [Bug target/112567] [14 regression] ICE in  RTL pass: split2: Segmentation fault
  2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-11-16 16:03 ` ubizjak at gmail dot com
@ 2023-11-16 19:15 ` slyfox at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-11-16 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
The fix allowed me to build linux-6.6.1 successfully with current gcc-master.
Thank you!

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

end of thread, other threads:[~2023-11-16 19:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 12:39 [Bug target/112567] New: [14 regression] ICE in RTL pass: split2: Segmentation fault slyfox at gcc dot gnu.org
2023-11-16 12:44 ` [Bug target/112567] " rguenth at gcc dot gnu.org
2023-11-16 13:10 ` ubizjak at gmail dot com
2023-11-16 14:05 ` dcb314 at hotmail dot com
2023-11-16 15:59 ` cvs-commit at gcc dot gnu.org
2023-11-16 16:03 ` ubizjak at gmail dot com
2023-11-16 19:15 ` slyfox 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).