https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83119
Bug ID: 83119 Summary: segmentation fault due to two_valued_val_range_p passing NULL to to_wide Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: amodra at gmail dot com Target Milestone: --- Created attachment 42686 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42686&action=edit preprocessed source during GIMPLE pass: vrp fetch-value.c: In function '_td_locate_field': fetch-value.c:44:1: internal compiler error: Segmentation fault _td_locate_field (td_thragent_t *ta, ^~~~~~~~~~~~~~~~ 0x1097582b crash_signal /home/amodra/src/gcc/gcc/toplev.c:325 0x10321d34 tree_int_cst_elt_check(tree_node const*, int, char const*, int, char const*) /home/amodra/src/gcc/gcc/tree.h:3277 0x10321d34 wi::to_wide(tree_node const*) /home/amodra/src/gcc/gcc/tree.h:5246 0x10db57cf vr_values::two_valued_val_range_p(tree_node*, tree_node**, tree_node**) /home/amodra/src/gcc/gcc/vr-values.c:4053 0x10dbd983 vr_values::simplify_stmt_using_ranges(gimple_stmt_iterator*) /home/amodra/src/gcc/gcc/vr-values.c:4116 0x10cfff33 vrp_folder::simplify_stmt_using_ranges(gimple_stmt_iterator*) /home/amodra/src/gcc/gcc/tree-vrp.c:6362 0x10cfff33 vrp_folder::fold_stmt(gimple_stmt_iterator*) /home/amodra/src/gcc/gcc/tree-vrp.c:6437 0x10bce873 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*) /home/amodra/src/gcc/gcc/tree-ssa-propagate.c:1073 0x112ad263 dom_walker::walk(basic_block_def*) /home/amodra/src/gcc/gcc/domwalk.c:308 0x10bcd3c7 substitute_and_fold_engine::substitute_and_fold() /home/amodra/src/gcc/gcc/tree-ssa-propagate.c:1173 0x10d0019b vrp_prop::vrp_finalize(bool) /home/amodra/src/gcc/gcc/tree-vrp.c:6788 0x10d1236b execute_vrp /home/amodra/src/gcc/gcc/tree-vrp.c:6864 Starting program: /home/amodra/gnu/libexec/gcc/powerpc64-linux/8.0.0/cc1 -fpreprocessed fetch-value.i -msecure-plt -quiet -dumpbase fetch-value.c -mcpu=power7 -mlong-double-128 -auxbase-strip /home/amodra/build/glibc/nptl_db/fetch-value.os -g -O2 -Wall -Werror -Wundef -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -std=gnu11 -version -fgnu89-inline -fmerge-all-constants -fno-stack-protector -frounding-math -fpic -o fetch-value.s GNU C11 (GCC) version 8.0.0 20171122 (experimental) (powerpc64-linux) compiled by GNU C version 8.0.0 20171122 (experimental), GMP version 6.0.0, MPFR version 3.1.1, MPC version 1.0.1, isl version none GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 GNU C11 (GCC) version 8.0.0 20171122 (experimental) (powerpc64-linux) compiled by GNU C version 8.0.0 20171122 (experimental), GMP version 6.0.0, MPFR version 3.1.1, MPC version 1.0.1, isl version none GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 7c4ca94b129285c9da74e4b0a828d58f Program received signal SIGSEGV, Segmentation fault. wi::to_wide (t=0x0) at /home/amodra/src/gcc/gcc/tree.h:5246 5246 return wi::storage_ref (&TREE_INT_CST_ELT (t, 0), TREE_INT_CST_NUNITS (t), Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7.ppc64 gmp-6.0.0-15.el7.ppc64 libmpc-1.0.1-3.el7.ppc64 mpfr-3.1.1-4.el7.ppc64 (gdb) up #1 0x0000000010db57d0 in vr_values::two_valued_val_range_p (this=this@entry=0x3fffffffe248, var=var@entry=0x3fffb5b7ac20, a=a@entry=0x3fffffffdd08, b=b@entry=0x3fffffffdd00) at /home/amodra/src/gcc/gcc/vr-values.c:4053 4053 - wi::to_wide (vrp_val_min (TREE_TYPE (var)))) == 1 (gdb) p debug_tree(var) <ssa_name 0x3fffb5b7ac20 type <pointer_type 0x3fffb5f20e70 psaddr_t type <void_type 0x3fffb5b90f18 void asm_written VOID align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x3fffb5b90f18 pointer_to_this <pointer_type 0x3fffb5b91068>> sizes-gimplified asm_written public unsigned DI size <integer_cst 0x3fffb5aa0ff0 constant 64> unit-size <integer_cst 0x3fffb5aa1008 constant 8> align:64 warn_if_not_align:0 symtab:16383 alias-set -1 canonical-type 0x3fffb5b91068 context <translation_unit_decl 0x3fffb5d416f8 fetch-value.c> pointer_to_this <pointer_type 0x3fffb5f23288>> var <parm_decl 0x3fffb5e2f400 idx> def_stmt idx_62 = ASSERT_EXPR <idx_47(D), idx_47(D) != 0B>; version:62 ptr-info 0x3fffb3a12ca0> $1 = void