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

            Bug ID: 117595
           Summary: ICE: SIGSEGV in mark_jump_label_1 (jump.cc:1051) with
                    -mbig-endian and _Atomic enum
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: riscv64-unknown-linux-gnu

Created attachment 59600
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59600&action=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -mbig-endian testcase.c -wrapper
valgrind,-q,--num-callers=100
==25540== Invalid read of size 1
==25540==    at 0x1599FAC: mark_jump_label_1(rtx_def*, rtx_insn*, bool, bool)
(jump.cc:1051)
==25540==    by 0x159A136: mark_jump_label_1(rtx_def*, rtx_insn*, bool, bool)
(jump.cc:1180)
==25540==    by 0x159A081: mark_jump_label_1(rtx_def*, rtx_insn*, bool, bool)
(jump.cc:1174)
==25540==    by 0x159A136: mark_jump_label_1(rtx_def*, rtx_insn*, bool, bool)
(jump.cc:1180)
==25540==    by 0x159AA6C: mark_all_labels (jump.cc:335)
==25540==    by 0x159AA6C: rebuild_jump_labels_1(rtx_insn*, bool) (jump.cc:74)
==25540==    by 0x1239581: (anonymous
namespace)::pass_expand::execute(function*) (cfgexpand.cc:6961)
==25540==    by 0x16935DA: execute_one_pass(opt_pass*) (passes.cc:2660)
==25540==    by 0x1693ECF: execute_pass_list_1(opt_pass*) (passes.cc:2769)
==25540==    by 0x1693F08: execute_pass_list(function*, opt_pass*)
(passes.cc:2780)
==25540==    by 0x127B135: expand (cgraphunit.cc:1846)
==25540==    by 0x127B135: cgraph_node::expand() (cgraphunit.cc:1799)
==25540==    by 0x127C049: output_in_order (cgraphunit.cc:2196)
==25540==    by 0x127C049: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2402)
==25540==    by 0x127EFF7: compile (cgraphunit.cc:2316)
==25540==    by 0x127EFF7: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2590)
==25540==    by 0x17D8262: compile_file() (toplev.cc:480)
==25540==    by 0x10687BE: do_compile (toplev.cc:2211)
==25540==    by 0x10687BE: toplev::main(int, char**) (toplev.cc:2371)
==25540==    by 0x106A97A: main (main.cc:39)
==25540==  Address 0x2 is not stack'd, malloc'd or (recently) free'd
==25540== 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:2:19: internal compiler error: Segmentation fault
    2 | void foo() { e++; }
      |                   ^
0x33d881e internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:518
0x17d7bdf crash_signal
        /repo/gcc-trunk/gcc/toplev.cc:323
0x1599fac mark_jump_label_1
        /repo/gcc-trunk/gcc/jump.cc:1051
0x159a136 mark_jump_label_1
        /repo/gcc-trunk/gcc/jump.cc:1180
0x159a081 mark_jump_label_1
        /repo/gcc-trunk/gcc/jump.cc:1174
0x159a136 mark_jump_label_1
        /repo/gcc-trunk/gcc/jump.cc:1180
0x159aa6c mark_all_labels
        /repo/gcc-trunk/gcc/jump.cc:335
0x159aa6c rebuild_jump_labels_1
        /repo/gcc-trunk/gcc/jump.cc:74
0x1239581 execute
        /repo/gcc-trunk/gcc/cfgexpand.cc:6961
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r15-5290-20241114132741-g361050589b1-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/15.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--enable-libsanitizer --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-5290-20241114132741-g361050589b1-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20241114 (experimental) (GCC)

Reply via email to