public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/110418] New: ICE on valid code at -O2 and -O3 with -fselective-scheduling2: Segmentation fault
@ 2023-06-26 20:23 zhendong.su at inf dot ethz.ch
  0 siblings, 0 replies; only message in thread
From: zhendong.su at inf dot ethz.ch @ 2023-06-26 20:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110418
           Summary: ICE on valid code at -O2 and -O3 with
                    -fselective-scheduling2: Segmentation fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

This appears to be a long-latent issue, affecting 6.* and later. 

Compiler Explorer: https://godbolt.org/z/sG5bsxrKq

[506] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230625 (experimental) [master r14-924-gd709841ae0f] (GCC) 
[507] % 
[507] % gcctk -O2 -fselective-scheduling2 small.c
during RTL pass: sched2
small.c: In function ‘main’:
small.c:20:1: internal compiler error: Segmentation fault
   20 | }
      | ^
0xfc7c03 crash_signal
        ../../gcc-trunk/gcc/toplev.cc:314
0x7fdf8a71151f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xf726a0 init_expr
        ../../gcc-trunk/gcc/sel-sched-ir.cc:1627
0xf726a0 copy_expr_onside(_expr*, _expr*)
        ../../gcc-trunk/gcc/sel-sched-ir.cc:1685
0xf80619 move_op_orig_expr_found
        ../../gcc-trunk/gcc/sel-sched.cc:5989
0xf856d9 code_motion_path_driver
        ../../gcc-trunk/gcc/sel-sched.cc:6543
0xf85c49 code_motion_process_successors
        ../../gcc-trunk/gcc/sel-sched.cc:6342
0xf85c49 code_motion_path_driver
        ../../gcc-trunk/gcc/sel-sched.cc:6608
0xf85c49 code_motion_process_successors
        ../../gcc-trunk/gcc/sel-sched.cc:6342
0xf85c49 code_motion_path_driver
        ../../gcc-trunk/gcc/sel-sched.cc:6608
0xf85c49 code_motion_process_successors
        ../../gcc-trunk/gcc/sel-sched.cc:6342
0xf85c49 code_motion_path_driver
        ../../gcc-trunk/gcc/sel-sched.cc:6608
0xf85c49 code_motion_process_successors
        ../../gcc-trunk/gcc/sel-sched.cc:6342
0xf85c49 code_motion_path_driver
        ../../gcc-trunk/gcc/sel-sched.cc:6608
0xf86279 move_op
        ../../gcc-trunk/gcc/sel-sched.cc:6702
0xf86279 move_exprs_to_boundary
        ../../gcc-trunk/gcc/sel-sched.cc:5223
0xf86279 schedule_expr_on_boundary
        ../../gcc-trunk/gcc/sel-sched.cc:5436
0xf887ef fill_insns
        ../../gcc-trunk/gcc/sel-sched.cc:5578
0xf887ef schedule_on_fences
        ../../gcc-trunk/gcc/sel-sched.cc:7353
0xf887ef sel_sched_region_2
        ../../gcc-trunk/gcc/sel-sched.cc:7491
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.
[508] % 
[508] % cat small.c
int printf (const char *, ...);
volatile int a, c, e;
int b = 1, d, f = 1;
int main ()
{
  int h, i = b - c, k;
  char j;
L:
  j = k = ~(-(b * a) / f);
  c = -((1 - d / b) | ((c | 1 / j) - b));
  e = ~((1 & b) ^ e) / ~f;
  if (a)
    printf ("%d", h);
  if (!(a || k < 2 || a))
    e = j;
  if (a < d || e)
    goto L;
  d = f && i;
  return 0;
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-26 20:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 20:23 [Bug rtl-optimization/110418] New: ICE on valid code at -O2 and -O3 with -fselective-scheduling2: Segmentation fault zhendong.su at inf dot ethz.ch

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