public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1)
@ 2021-05-16 18:05 haoxintu at gmail dot com
  2021-05-17  1:54 ` [Bug target/100626] " haoxintu at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: haoxintu at gmail dot com @ 2021-05-16 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100626
           Summary: ICE Segmentation fault (during RTL pass: split1)
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi all.

I don't know if there is a dup of this. I have searched but failed.

$cat small.c
#include <stdint.h>
int uc_4, i_5, us_7;
void fn1() {
  int li_18;
  int64_t *ptr_43 = &li_18;
  for (; us_7;) {
    fn2();
    *ptr_43 ^= uc_4;
  }
  i_5 = li_18;
}

$gcc -w -O1 -m32 small.c
during RTL pass: split1
small.c: In function ‘fn1’:
small.c:11:1: internal compiler error: Segmentation fault
   11 | }
      | ^
0xb2bebf crash_signal
        ../../gcc/toplev.c:327
0xe885ca ix86_fixup_binary_operands(rtx_code, machine_mode, rtx_def**)
        ../../gcc/config/i386/i386-expand.c:900
0xe8877b ix86_expand_binary_operator(rtx_code, machine_mode, rtx_def**)
        ../../gcc/config/i386/i386-expand.c:943
0x11a016e gen_split_216(rtx_insn*, rtx_def**)
        ../../gcc/config/i386/i386.md:9714
0x137d6a2 split_insns(rtx_def*, rtx_insn*)
        ../../gcc/config/i386/i386.md:14112
0x808ffe try_split(rtx_def*, rtx_insn*, int)
        ../../gcc/emit-rtl.c:3834
0xaa0f51 split_insn
        ../../gcc/recog.c:3363
0xaa63e7 split_all_insns()
        ../../gcc/recog.c:3467
0xaa6478 execute
        ../../gcc/recog.c:4385
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/users/htu42656/compilers/gcc-11.1.0/build/libexec/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
--prefix=/users/htu42656/compilers/gcc-11.1.0/build/ --enable-bootstrap
--enable-checking=release --enable-languages=c,c++ --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.1.0 (GCC) 


Thanks,
Haoxin

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

* [Bug target/100626] ICE Segmentation fault (during RTL pass: split1)
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
@ 2021-05-17  1:54 ` haoxintu at gmail dot com
  2021-05-17  8:08 ` [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2 marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: haoxintu at gmail dot com @ 2021-05-17  1:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Haoxin Tu <haoxintu at gmail dot com> ---
Another test case that crashes on all -O1 to -Os.


$cat small.c
#include <stdint.h>
int uc_4, i_5, us_7;
void fn1() {
  int li_18;
  int64_t *ptr_43 = &li_18;
  for (; us_7;) {
    fn2();
    *ptr_43 ^= uc_4;
  }
  i_5 = li_18;
}

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
  2021-05-17  1:54 ` [Bug target/100626] " haoxintu at gmail dot com
@ 2021-05-17  8:08 ` marxin at gcc dot gnu.org
  2021-05-17  8:53 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-05-17  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-05-17
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
            Summary|ICE Segmentation fault      |[11/12 Regression] ICE
                   |(during RTL pass: split1)   |Segmentation fault (during
                   |                            |RTL pass: split1) since
                   |                            |r11-165-geb72dc663e9070b2
     Ever confirmed|0                           |1

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-165-geb72dc663e9070b2.

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
  2021-05-17  1:54 ` [Bug target/100626] " haoxintu at gmail dot com
  2021-05-17  8:08 ` [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2 marxin at gcc dot gnu.org
@ 2021-05-17  8:53 ` jakub at gcc dot gnu.org
  2021-05-17 11:26 ` ubizjak at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-17  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (2 preceding siblings ...)
  2021-05-17  8:53 ` jakub at gcc dot gnu.org
@ 2021-05-17 11:26 ` ubizjak at gmail dot com
  2021-05-17 12:49 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2021-05-17 11:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
*<any_or:code>di3_doubleword calls split_double_mode with:

op0: (subreg:DI (reg/v:SI 89 [ li_18 ]) 0)
op1: (reg:DI 90 [ uc_4 ])
op2: (mem/c:DI (plus:SI (reg/f:SI 19 frame)
            (const_int -4 [0xfffffffffffffffc])) [0  S8 A32])

and split_double_mode chokes on paradoxical subreg op0, returning (nil) on
highpart of op0:

(reg/v:SI 89 [ li_18 ])
(subreg:SI (reg:DI 90 [ uc_4 ]) 0)
(mem/c:SI (plus:SI (reg/f:SI 19 frame)
        (const_int -4 [0xfffffffffffffffc])) [0  S4 A32])

(nil)
(subreg:SI (reg:DI 90 [ uc_4 ]) 4)
(mem/c:SI (reg/f:SI 19 frame) [0  S4 A32])

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (3 preceding siblings ...)
  2021-05-17 11:26 ` ubizjak at gmail dot com
@ 2021-05-17 12:49 ` rguenth at gcc dot gnu.org
  2021-05-17 18:09 ` haoxintu at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-05-17 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (4 preceding siblings ...)
  2021-05-17 12:49 ` rguenth at gcc dot gnu.org
@ 2021-05-17 18:09 ` haoxintu at gmail dot com
  2021-05-17 18:37 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: haoxintu at gmail dot com @ 2021-05-17 18:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Haoxin Tu <haoxintu at gmail dot com> ---
I found that it also crashes (under -O1 and -Os) on today's trunk version of
GCC.

$cat small.c
#include <stdint.h>
int a;
void b() {
  int c;
  uint64_t *d = &c;
  uint8_t *e;
  if (a)
    *d &= *e;
  if (*d)
    for (;;)
      ;
}

$gcc -w -O1 -m32 small.c (or -Os)
during RTL pass: split1
small.c: In function ‘b’:
small.c:12:1: internal compiler error: Segmentation fault
   12 | }
      | ^
0xba0cef crash_signal
        ../../gcc/toplev.c:327
0xefc40a ix86_fixup_binary_operands(rtx_code, machine_mode, rtx_def**)
        ../../gcc/config/i386/i386-expand.c:900
0xefc5bb ix86_expand_binary_operator(rtx_code, machine_mode, rtx_def**)
        ../../gcc/config/i386/i386-expand.c:943
0x1214538 gen_andsi3(rtx_def*, rtx_def*, rtx_def*)
        ../../gcc/config/i386/i386.md:9091
0x12147b4 gen_split_191(rtx_insn*, rtx_def**)
        ../../gcc/config/i386/i386.md:9123
0x13f8f22 split_insns(rtx_def*, rtx_insn*)
        ../../gcc/config/i386/i386.md:14140
0x87e61e try_split(rtx_def*, rtx_insn*, int)
        ../../gcc/emit-rtl.c:3786
0xb15ad1 split_insn
        ../../gcc/recog.c:3363
0xb1af47 split_all_insns()
        ../../gcc/recog.c:3467
0xb1afd8 execute
        ../../gcc/recog.c:4385
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/media/haoxin/SeagateData/haoxin-data/dut-research/compilers/gcc/build/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure
--prefix=/home/haoxin/haoxin-data/dut-research/compilers/gcc/build/
--enable-bootstrap --enable-checking=release --enable-languages=c,c++
--enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210517 (experimental) (GCC)

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (5 preceding siblings ...)
  2021-05-17 18:09 ` haoxintu at gmail dot com
@ 2021-05-17 18:37 ` ubizjak at gmail dot com
  2021-05-18 13:46 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2021-05-17 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com
             Status|NEW                         |ASSIGNED

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 50828
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50828&action=edit
Proposed patch

Patch in testing.

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (6 preceding siblings ...)
  2021-05-17 18:37 ` ubizjak at gmail dot com
@ 2021-05-18 13:46 ` cvs-commit at gcc dot gnu.org
  2021-05-25 17:22 ` cvs-commit at gcc dot gnu.org
  2021-05-25 17:23 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-18 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:d39fbed75810fc7478842503ecb0268b85dc9c2e

commit r12-878-gd39fbed75810fc7478842503ecb0268b85dc9c2e
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Tue May 18 15:45:54 2021 +0200

    i386: Fix split_double_mode with paradoxical subreg [PR100626]

    split_double_mode calls simplify_gen_subreg, which fails for the
    high half of the paradoxical subreg.  Return temporary register
    instead of NULL RTX in this case.

    2021-05-18  Uroš Bizjak  <ubizjak@gmail.com>

    gcc/
            PR target/100626
            * config/i386/i386-expand.c (split_double_mode): Return
            temporary register when simplify_gen_subreg fails with
            the high half od the paradoxical subreg.

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (7 preceding siblings ...)
  2021-05-18 13:46 ` cvs-commit at gcc dot gnu.org
@ 2021-05-25 17:22 ` cvs-commit at gcc dot gnu.org
  2021-05-25 17:23 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-25 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:6be2c12e37b167890d68587086a2186358b64c02

commit r11-8468-g6be2c12e37b167890d68587086a2186358b64c02
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Tue May 18 15:45:54 2021 +0200

    i386: Fix split_double_mode with paradoxical subreg [PR100626]

    split_double_mode calls simplify_gen_subreg, which fails for the
    high half of the paradoxical subreg.  Return temporary register
    instead of NULL RTX in this case.

    2021-05-18  Uroš Bizjak  <ubizjak@gmail.com>

    gcc/
            PR target/100626
            * config/i386/i386-expand.c (split_double_mode): Return
            temporary register when simplify_gen_subreg fails with
            the high half od the paradoxical subreg.

    (cherry picked from commit d39fbed75810fc7478842503ecb0268b85dc9c2e)

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

* [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2
  2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
                   ` (8 preceding siblings ...)
  2021-05-25 17:22 ` cvs-commit at gcc dot gnu.org
@ 2021-05-25 17:23 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2021-05-25 17:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
             Target|x86_64-linux-gnu            |x86
                   |i?86-linux-gnu              |

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

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

end of thread, other threads:[~2021-05-25 17:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-16 18:05 [Bug tree-optimization/100626] New: ICE Segmentation fault (during RTL pass: split1) haoxintu at gmail dot com
2021-05-17  1:54 ` [Bug target/100626] " haoxintu at gmail dot com
2021-05-17  8:08 ` [Bug target/100626] [11/12 Regression] ICE Segmentation fault (during RTL pass: split1) since r11-165-geb72dc663e9070b2 marxin at gcc dot gnu.org
2021-05-17  8:53 ` jakub at gcc dot gnu.org
2021-05-17 11:26 ` ubizjak at gmail dot com
2021-05-17 12:49 ` rguenth at gcc dot gnu.org
2021-05-17 18:09 ` haoxintu at gmail dot com
2021-05-17 18:37 ` ubizjak at gmail dot com
2021-05-18 13:46 ` cvs-commit at gcc dot gnu.org
2021-05-25 17:22 ` cvs-commit at gcc dot gnu.org
2021-05-25 17:23 ` ubizjak at gmail dot com

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