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

            Bug ID: 84745
           Summary: internal compiler error: Segmentation fault
                    (main_block_label())
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegard.nossum at gmail dot com
                CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

void a() {
  alignof(({
    b: 0;
  }));
  goto b;
}

Output:

$ xgcc -x c++ -S -
during GIMPLE pass: cfg
<stdin>: In function 'void a()':
<stdin>:1:6: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
        /home/vegard/git/gcc/gcc/toplev.c:325
0x32834db main_block_label
        /home/vegard/git/gcc/gcc/tree-cfg.c:1496
0x3292fff cleanup_dead_labels()
        /home/vegard/git/gcc/gcc/tree-cfg.c:1679
0x32f0b70 build_gimple_cfg
        /home/vegard/git/gcc/gcc/tree-cfg.c:240
0x32f0b70 execute_build_cfg
        /home/vegard/git/gcc/gcc/tree-cfg.c:410
0x32f0b70 execute
        /home/vegard/git/gcc/gcc/tree-cfg.c:446

$ xgcc --version
xgcc (GCC) 8.0.1 20180306 (experimental)

Built from git 11a93d7a09b871b3b9a2eb108eb91ad83d94e070 (r258271).

Funnily, clang also segfaults on this exact input.

Test case was minimised by C-Reduce.

Reply via email to