https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87134
Bug ID: 87134
Summary: [9 regression] SEGV in cc1 caused by r263875
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: ro at gcc dot gnu.org
CC: rguenth at gcc dot gnu.org
Target Milestone: ---
Host: *-*-solaris2.11
Target: *-*-solaris2.11
Build: *-*-solaris2.11
Between 20180822 (r263778) and 20180828 (r263922), Solaris bootstrap (both
sparc
and x86) broke like this:
/var/gcc/reghunt/tspsegv/48038/./gcc/xgcc
-B/var/gcc/reghunt/tspsegv/48038/./gcc/ -B/usr/local/i386-pc-solaris2.11/bin/
-B/usr/local/i386-pc-solaris2.11/lib/ -isystem
/usr/local/i386-pc-solaris2.11/include -isystem
/usr/local/i386-pc-solaris2.11/sys-include -fno-checking -DHAVE_CONFIG_H -I..
-I/var/gcc/reghunt/trunk/libstdc++-v3/../libiberty
-I/var/gcc/reghunt/trunk/libstdc++-v3/../include -D_GLIBCXX_SHARED
-I/var/gcc/reghunt/tspsegv/48038/i386-pc-solaris2.11/libstdc++-v3/include/i386-pc-solaris2.11
-I/var/gcc/reghunt/tspsegv/48038/i386-pc-solaris2.11/libstdc++-v3/include
-I/var/gcc/reghunt/trunk/libstdc++-v3/libsupc++ -g -O2 -DIN_GLIBCPP_V3
-Wno-error -c cp-demangle.c -fPIC -DPIC -o cp-demangle.o -v -save-temps
[...]
xgcc: internal compiler error: Segmentation Fault signal terminated program cc1
during stage2 (also in several other places). A reghunt identified this patch
as the culprit:
2018-08-27 Richard Biener <[email protected]>
* cfganal.h (rev_post_order_and_mark_dfs_back_seme): Declare.
* cfganal.c (rev_post_order_and_mark_dfs_back_seme): New function.
* tree-ssa-sccvn.h (struct vn_pval): New structure.
(struct vn_nary_op_s): Add unwind_to member. Add
predicated_values flag and put result into a union together
with a linked list of vn_pval.
(struct vn_ssa_aux): Add name member to make maintaining
a map of SSA name to vn_ssa_aux possible. Remove no longer
needed info, dfsnum, low, visited, on_sccstack, use_processed
and range_info_anti_range_p members.
(run_scc_vn, vn_eliminate, free_scc_vn, vn_valueize): Remove.
(do_rpo_vn, run_rpo_vn, eliminate_with_rpo_vn, free_rpo_vn):
New functions.
(vn_valueize): New global.
(vn_context_bb): Likewise.
(VN_INFO_RANGE_INFO, VN_INFO_ANTI_RANGE_P, VN_INFO_RANGE_TYPE,
VN_INFO_PTR_INFO): Remove.
* tree-ssa-sccvn.c: ... (rewrite)
(pass_fre::execute): For -O2+ initialize loops and run
RPO VN in optimistic mode (iterating). For -O1 and -Og
run RPO VN in non-optimistic mode.
[...]
Unfortunately, the error is somewhat evasive: running cc1 directly on the .i
file succeeds. However, the core dump reveals a bit more. While gdb cannot
handle it, dbx can:
program terminated by signal SEGV (no mapping at the fault address)
0xfaae80cc: t_splay+0x0026: movl 0x00000008(%esi),%edx
Current function is crash_signal
325 internal_error ("%s", strsignal (signo));
(dbx) where
dbx: warning: loop detected in stack
[1] t_splay(0xabd2150, 0x0, 0xfabbe145, 0xfaae7f5e), at 0xfaae80cc
[2] t_delete(0xabd2150, 0xfac08000, 0xfeffb398, 0xfaae7bf6), at 0xfaae7f81
[3] realfree(0xabd2138, 0xf9214fa0, 0x8848cd8, 0xfaae7d7f), at 0xfaae7c48
[4] _morecore(0x40, 0xfac08000, 0xfac09348, 0xfaae7574), at 0xfaae7f23
[5] _malloc_unlocked(0x3c), at 0xfaae7712
[6] do_malloc(0x3c, 0x0, 0xfeffb498, 0xfaae74cc), at 0xfaae7537
[7] malloc(0x3c, 0x0, 0xa, 0xfaafcb62), at 0xfaae74e0
[8] strdup(0xfeffb720, 0x14, 0xfeffb4d8, 0xfab13d48), at 0xfaafcb7e
[9] handle_mo(0xfeffb5c0, 0xfeffbb6c, 0x0, 0xfab12591), at 0xfab13db6
[10] _real_gettext_u_l(0xfaaab6ac, 0xfaa585b4, 0x0, 0x0, 0x5, 0x0,
0xfeffbb6c, 0xfab12c81), at 0xfab1296a
[11] _real_gettext_u(0xfaaab6ac, 0xfaa585b4, 0x0, 0x0, 0x5, 0x0, 0xfeffbbb8,
0xfab10891), at 0xfab12caf
[12] dgettext(0xfaaab6ac, 0xfaa585b4, 0x0, 0xfaafcfb4), at 0xfab108cf
[13] strsignal(0xb, 0x0, 0x1, 0x0), at 0xfaafcfe6
=>[14] crash_signal(signo = 11), line 325 in "toplev.c"
[15] __sighndlr(0xb, 0x0, 0xfeffbcd0, 0x93d6d44), at 0xfabba015
[16] call_user_handler(0xb), at 0xfabac0ec
[17] sigacthandler(0xb, 0x0, 0xfeffbcd0, 0x1f, 0x0, 0x0), at 0xfabac59b
---- called from signal handler with signal 11 (SIGSEGV) ------
[18] t_splay(0xabd21cc, 0x2, 0x87282bc, 0xfaae7f5e), at 0xfaae80cc
[19] t_delete(0xabd21cc, 0x0, 0xfeffca18, 0xfaae7bf6), at 0xfaae7f81
[20] realfree(0xabd2158, 0x3082fe, 0xfac09348, 0xfaae7574), at 0xfaae7c48
[21] _malloc_unlocked(0x18), at 0xfaae7782
[22] do_malloc(0x18, 0x0, 0xfeffcaf8, 0xfaae74cc), at 0xfaae7537
[23] malloc(0x18, 0x2011c7, 0x80471eed, 0x7ee65b58), at 0xfaae74e0
[24] xrealloc(oldmem = (nil), size = 24U), line 177 in "xmalloc.c"
[25] va_heap::reserve<std::pair<int, int> >(v = (nil), reserve = 2U, exact =
true), line 288 in "vec.h"
[26] vec<std::pair<int, int>, va_heap, vl_ptr>::reserve(this = 0xabdf7bc,
nelems = 2U, exact = true), line 1621 in "vec.h"
[27] vec<std::pair<int, int>, va_heap, vl_ptr>::reserve_exact(this =
0xabdf7bc, nelems = 2U), line 1641 in "vec.h"
[28] rpo_elim::eliminate_push_avail(this = 0xfeffcd90, bb = 0xf9a50c30,
leader = 0xf96bd230), line 5770 in "tree-ssa-sccvn.c"
[29] process_bb(avail = CLASS, bb = 0xf9a50c30, bb_visited = false,
iterate_phis = false, iterate = true, eliminate = false, do_region = false,
exit_bbs = (nil)), line 6124 in "tree-ssa-sccvn.c"
[30] do_rpo_vn(fn = 0xf9fd5618, entry = 0xf9aedb60, exit_bbs = (nil), iterate
= true, eliminate = false), line 6405 in "tree-ssa-sccvn.c"
[31] run_rpo_vn(kind = <unknown enum member -16789756>), line 5531 in
"tree-ssa-sccvn.c"