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

--- Comment #6 from Daniel Kolesa <gcc at octaforge dot org> ---
If it helps, I have reduced the patches to just the two that strictly necessary
for stage 1 build (I can't get rid of those, sorry, that would be asking for
the impossible), which are:

https://github.com/chimera-linux/cports/blob/master/experimental/gcc/patches/clang-tree-vect.patch
https://github.com/chimera-linux/cports/blob/master/experimental/gcc/patches/clang17.patch

and reproduced the exact same segfault on the same files with the exact same
backtrace.

Therefore, I can safely conclude that the patches are 100% irrelevant to the
problem at hand, as the two remaining ones are merely small build fixes.

------

libtool: compile:  /builddir/gcc-13.2.1_git20231014/build/./gcc/xgcc
-shared-libgcc -B/builddir/gcc-13.2.1_git20231014/build/./gcc -nostdinc++
-L/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/src
-L/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/src/.libs
-L/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/libsupc++/.libs
-B/usr/powerpc64le-chimera-linux-musl/bin/
-B/usr/powerpc64le-chimera-linux-musl/lib/ -isystem
/usr/powerpc64le-chimera-linux-musl/include -isystem
/usr/powerpc64le-chimera-linux-musl/sys-include -fno-checking
-I/builddir/gcc-13.2.1_git20231014/libstdc++-v3/../libgcc
-I/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/include/powerpc64le-chimera-linux-musl
-I/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/include
-I/builddir/gcc-13.2.1_git20231014/libstdc++-v3/libsupc++ -std=gnu++17
-nostdinc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra
-Wwrite-strings -Wcast-qual -Wabi=2 -fdiagnostics-show-location=once
-ffunction-sections -fdata-sections -frandom-seed=floating_from_chars.lo
-fimplicit-templates -fstack-clash-protection -mtune=power9 -O2
-ffile-prefix-map=/builddir/gcc-13.2.1_git20231014=. -g2 -D_GNU_SOURCE -c
/builddir/gcc-13.2.1_git20231014/libstdc++-v3/src/c++17/floating_from_chars.cc 
-fPIC -DPIC -D_GLIBCXX_SHARED -o floating_from_chars.o
during RTL pass: combine
In file included from
/builddir/gcc-13.2.1_git20231014/libstdc++-v3/src/c++17/floating_from_chars.cc:86:
/builddir/gcc-13.2.1_git20231014/libstdc++-v3/src/c++17/fast_float/fast_float.h:
In function '{anonymous}::fast_float::adjusted_mantissa
{anonymous}::fast_float::digit_comp(parsed_number_string&, adjusted_mantissa)
[with T = float]':
/builddir/gcc-13.2.1_git20231014/libstdc++-v3/src/c++17/fast_float/fast_float.h:2850:1:
internal compiler error: Segmentation fault
 2850 | }
      | ^
0x1279a323 crash_signal(int)
        /builddir/gcc-13.2.1_git20231014/gcc/toplev.cc:314


cc1plus:

/builddir/gcc-13.2.1_git20231014/build/./gcc/cc1plus -quiet -nostdinc++
-nostdinc++ -v -I /builddir/gcc-13.2.1_git20231014/libstdc++-v3/../libgcc -I
/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/include/powerpc64le-chimera-linux-musl
-I
/builddir/gcc-13.2.1_git20231014/build/powerpc64le-chimera-linux-musl/libstdc++-v3/include
-I /builddir/gcc-13.2.1_git20231014/libstdc++-v3/libsupc++ -iprefix
/builddir/gcc-13.2.1_git20231014/build/gcc/../lib/gcc/powerpc64le-chimera-linux-musl/13.2.1/
-isystem /builddir/gcc-13.2.1_git20231014/build/./gcc/include -isystem
/builddir/gcc-13.2.1_git20231014/build/./gcc/include-fixed -D_GNU_SOURCE -D
_GLIBCXX_SHARED -D _GNU_SOURCE -D PIC -D _GLIBCXX_SHARED -isystem
/usr/powerpc64le-chimera-linux-musl/include -isystem
/usr/powerpc64le-chimera-linux-musl/sys-include
/builddir/gcc-13.2.1_git20231014/libstdc++-v3/src/c++17/floating_from_chars.cc
-msecure-plt -quiet -dumpbase floating_from_chars.cc -dumpbase-ext .cc
-mtune=power9 -mabi=elfv2 -g2 -O2 -Wall -Wextra -Wwrite-strings -Wcast-qual
-Wabi=2 -std=gnu++17 -version -fno-checking -fdiagnostics-show-location=once
-ffunction-sections -fdata-sections -frandom-seed=floating_from_chars.lo
-fimplicit-templates -fstack-clash-protection
-ffile-prefix-map=/builddir/gcc-13.2.1_git20231014=. -fPIC -o /tmp/ccLDfChm.s

backtrace:

* thread #1, name = 'cc1plus', stop reason = signal SIGSEGV: address not mapped
to object (fault address: 0x100000062)
    frame #0: 0x00000000115b750c cc1plus`recog_114(x1=0x00003fffe897a5a0,
insn=0x00003fffe8979b00, pnum_clobbers=0x00003fffffffda0c) at rs6000.md:8019:7
   8016    li %0,%1
   8017    mf%1 %0
   8018    mt%0 %1
-> 8019    lwz%U1%X1 %0,%1
   8020    stw%U0%X0 %1,%0"
   8021   [(set_attr_alternative "type"
   8022      [(const_string "cr_logical")
(lldb) bt
* thread #1, name = 'cc1plus', stop reason = signal SIGSEGV: address not mapped
to object (fault address: 0x100000062)
  * frame #0: 0x00000000115b750c cc1plus`recog_114(x1=0x00003fffe897a5a0,
insn=0x00003fffe8979b00, pnum_clobbers=0x00003fffffffda0c) at rs6000.md:8019:7
    frame #1: 0x000000001154aa50 cc1plus`recog_126(x1=0x00003fffe897a5a0,
insn=0x00003fffe8979b00, pnum_clobbers=0x00003fffffffda0c) at vsx.md:280:13
    frame #2: 0x00000000114f5fd0 cc1plus`recog_188(x1=0x00003fffe897a5a0,
insn=0x00003fffe8979b00, pnum_clobbers=0x00003fffffffda0c) at vector.md:851:14
    frame #3: 0x00000000114f0b74 cc1plus`recog(x1=0x00003fffe897a5a0,
insn=0x00003fffe8979b00, pnum_clobbers=0x00003fffffffda0c) at
altivec.md:1124:14
    frame #4: 0x00000000118a4d78
cc1plus`recog_for_combine_1(pnewpat=0x00003fffffffe7e0,
insn=0x00003fffe8979b00, pnotes=0x00003fffffffe798) at combine.cc:11356:22
    frame #5: 0x0000000011890644
cc1plus`recog_for_combine(pnewpat=0x00003fffffffe7e0, insn=0x00003fffe8979b00,
pnotes=0x00003fffffffe798) at combine.cc:11626:26
    frame #6: 0x00000000118823e4 cc1plus`try_combine(i3=0x00003fffe8979b00,
i2=0x00003fffe8979a40, i1=0x0000000000000000, i0=0x0000000000000000,
new_direct_jump_p=0x00003fffffffeb34, last_combined_insn=0x00003fffe8979b00) at
combine.cc:3544:24
    frame #7: 0x000000001187c008
cc1plus`combine_instructions(f=0x00003fffe890f268, nregs=1007) at
combine.cc:1266:18
    frame #8: 0x000000001187b0b4 cc1plus`rest_of_handle_combine() at
combine.cc:14982:7
    frame #9: 0x000000001187b008 cc1plus`(anonymous
namespace)::pass_combine::execute(this=0x00003fffef6069f0,
(null)=0x00003fffe8cb5730) at combine.cc:15027:14
    frame #10: 0x00000000123cfe94
cc1plus`execute_one_pass(pass=0x00003fffef6069f0) at passes.cc:2651:22
    frame #11: 0x00000000123d10f8
cc1plus`execute_pass_list_1(pass=0x00003fffef6069f0) at passes.cc:2760:11
    frame #12: 0x00000000123d1124
cc1plus`execute_pass_list_1(pass=0x00003fffef606ad0) at passes.cc:2761:2
    frame #13: 0x00000000123be268
cc1plus`execute_pass_list(fn=0x00003fffe8cb5730, pass=0x00003fffef600b70) at
passes.cc:2771:3
    frame #14: 0x00000000117ba19c
cc1plus`cgraph_node::expand(this=0x00003fffe8cdf220) at cgraphunit.cc:1841:3
    frame #15: 0x00000000117bd18c cc1plus`expand_all_functions() at
cgraphunit.cc:2024:14
    frame #16: 0x00000000117bbe80
cc1plus`symbol_table::compile(this=0x00003fffeda06000) at cgraphunit.cc:2398:3
    frame #17: 0x00000000117bda24
cc1plus`symbol_table::finalize_compilation_unit(this=0x00003fffeda06000) at
cgraphunit.cc:2583:3
    frame #18: 0x000000001279aa38 cc1plus`compile_file() at toplev.cc:471:15
    frame #19: 0x0000000012799adc cc1plus`do_compile(no_backend=false) at
toplev.cc:2125:11
    frame #20: 0x00000000127977c0 cc1plus`toplev::main(this=0x00003ffffffff3ee,
argc=61, argv=0x00003ffffffff4d8) at toplev.cc:2277:7
    frame #21: 0x0000000013069aa0 cc1plus`main(argc=61,
argv=0x00003ffffffff4d8) at main.cc:39:18
    frame #22: 0x00003fffefa66b70
    frame #23: 0x00003fffefa66ae0
    frame #24: 0x0000000010dda1bc cc1plus`_start_c(p=<unavailable>) at
crt1.c:18:2
    frame #25: 0x0000000010dda178 cc1plus`_start + 40

Reply via email to