public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/108426] New: [13 regression] SEGV in contains_struct_check
@ 2023-01-16 21:56 ro at gcc dot gnu.org
  2023-01-16 21:57 ` [Bug tree-optimization/108426] " ro at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: ro at gcc dot gnu.org @ 2023-01-16 21:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108426
           Summary: [13 regression] SEGV in contains_struct_check
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: andrew.carlotti at arm dot com
  Target Milestone: ---
              Host: sparc-sun-solaris2.11
            Target: sparc-sun-solaris2.11
             Build: sparc-sun-solaris2.11

Between 20230113 (9b6c624820050cd5e11b2fbd9c997f94b691295a) and 20230116
(b22634281fff352fcf71dd4fbbf6e6fcbc9a46cf),
Solaris/SPARC bootstrap broke compiling 64-bit strconv.lo:

during GIMPLE pass: evrp
In function 'strconv.atofHex':
go1: internal compiler error: Segmentation Fault 
libtool: compile:  /var/gcc/regression/master/11.4-gcc/build/./gcc/gccgo
-B/var/gcc/regression/master/11.4-gcc/build/./gcc/
-B/vol/gcc/sparc-sun-solaris2.11/bin/ -B/vol/gcc/sparc-sun-solaris2.11/lib/
-isystem /vol/gcc/sparc-sun-solaris2.11/include -isystem
/vol/gcc/sparc-sun-solaris2.11/sys-include -fchecking=1 -O2 -g -m64 -I . -c
-fgo-pkgpath=path /vol/gcc/src/hg/master/local/libgo/go/path/match.go
/vol/gcc/src/hg/master/local/libgo/go/path/path.go -o path.o >/dev/null 2>&1
0xf25ceb crash_signal
        /vol/gcc/src/hg/master/local/gcc/toplev.cc:314
0x12c5328 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /vol/gcc/src/hg/master/local/gcc/tree.h:3643
0x12c5328 build_call_expr_loc_array(unsigned int, tree_node*, int, tree_node**)
        /vol/gcc/src/hg/master/local/gcc/tree.cc:10686
0x12c5507 build_call_expr(tree_node*, int, ...)
        /vol/gcc/src/hg/master/local/gcc/tree.cc:10736
0x110738b build_cltz_expr
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:2300
0x1113e1f number_of_iterations_cltz_complement
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:2554
0x1113e1f number_of_iterations_bitcount
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:2640
0x1113e1f number_of_iterations_exit_assumptions(loop*, edge_def*,
tree_niter_desc*, gcond**, bool, basic_block_def**)
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:3186
0x1115ed7 number_of_iterations_exit(loop*, edge_def*, tree_niter_desc*, bool,
bool, basic_block_def**)
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:3275
0x1115ed7 estimate_numbers_of_iterations(loop*)
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:4845
0x1119683 loop_exits_before_overflow
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:5246
0x1119683 scev_probably_wraps_p(tree_node*, tree_node*, tree_node*, gimple*,
loop*, bool)
        /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:5498
0x1365a67 bounds_of_var_in_loop(tree_node**, tree_node**, range_query*, loop*,
gimple*, tree_node*)
        /vol/gcc/src/hg/master/local/gcc/vr-values.cc:524
0x19be32f fold_using_range::range_of_ssa_name_with_loop_info(vrange&,
tree_node*, loop*, gphi*, fur_source&)
        /vol/gcc/src/hg/master/local/gcc/gimple-range-fold.cc:957
0x19bf1f3 fold_using_range::range_of_phi(vrange&, gphi*, fur_source&)
/var/gcc/regression/master/11.4-gcc/build/i386-pc-solaris2.11/libstdc++-v3/include0x19bf1f3
fold_using_range::range_of_phi(vrange&, gphi*, fur_source&)
        /vol/gcc/src/hg/master/local/gcc/gimple-range-fold.cc:820
0x19c262f fold_using_range::fold_stmt(vrange&, gimple*, fur_source&,
tree_node*)
        /vol/gcc/src/hg/master/local/gcc/gimple-range-fold.cc:491
0x19b0b6b gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*)
        /vol/gcc/src/hg/master/local/gcc/gimple-range.cc:257
0x19b0b6b gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
        /vol/gcc/src/hg/master/local/gcc/gimple-range.cc:318
0x19b0e13 gimple_ranger::register_inferred_ranges(gimple*)
        /vol/gcc/src/hg/master/local/gcc/gimple-range.cc:474
0x12ad20b rvrp_folder::pre_fold_bb(basic_block_def*)
        /vol/gcc/src/hg/master/local/gcc/tree-vrp.cc:1045

gdb shows

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
build_call_expr_loc_array (loc=0, fndecl=<tree 0x0>, n=1, argarray=0xffbf8e70)
at /vol/gcc/src/hg/master/local/gcc/tree.cc:10686
10686     tree fntype = TREE_TYPE (fndecl);
(gdb) bt
#0  build_call_expr_loc_array (loc=0, fndecl=<tree 0x0>, n=1,
argarray=0xffbf8e70) at /vol/gcc/src/hg/master/local/gcc/tree.cc:10686
#1  0x012c5508 in build_call_expr (fndecl=<tree 0x0>, n=1) at
/vol/gcc/src/hg/master/local/gcc/tree.cc:10736
#2  0x0110738c in build_cltz_expr (src=<ssa_name 0xfaa81ef0 66>,
leading=<optimized out>, define_at_zero=<optimized out>) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:2300
#3  0x01113e20 in number_of_iterations_cltz_complement (exit=<optimized out>,
niter=0xffbf9200, code=NE_EXPR, loop=0xfaa84ee0) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:2554
#4  number_of_iterations_bitcount (niter=0xffbf9200, code=NE_EXPR,
exit=<optimized out>, loop=0xfaa84ee0) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:2640
#5  number_of_iterations_exit_assumptions (loop=0xfaa84ee0, exit=<optimized
out>, niter=0xffbf9200, at_stmt=<optimized out>, every_iteration=<optimized
out>, body=<optimized out>) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:3186
#6  0x01115ed8 in number_of_iterations_exit (body=0x2868528,
every_iteration=false, warn=false, niter=0xffbf9200, exit=<edge 0xfaaaec40 (12
-> 13)>, loop=0xfaa84ee0) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:3275
#7  estimate_numbers_of_iterations (loop=0xfaa84ee0) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:4845
#8  0x01119684 in loop_exits_before_overflow (loop=0xfaa84ee0,
at_stmt=<gimple_phi 0xf9868e70>, step=<integer_cst 0xfa881698>, base=<ssa_name
0xfaa81e78 65>) at /vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:5246
#9  scev_probably_wraps_p (var=<optimized out>, base=<ssa_name 0xfaa81e78 65>,
step=<integer_cst 0xfa881698>, at_stmt=<gimple_phi 0xf9868e70>,
loop=0xfaa84ee0, use_overflow_semantics=<optimized out>) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-loop-niter.cc:5498
#10 0x01365a68 in bounds_of_var_in_loop (min=0xffbfaeb8, max=0xffbfaebc,
query=0x27994c0, loop=0xfaa84ee0, stmt=<gimple_phi 0xf9868e70>, var=<optimized
out>) at /vol/gcc/src/hg/master/local/gcc/vr-values.cc:524
#11 0x019be330 in fold_using_range::range_of_ssa_name_with_loop_info
(this=<optimized out>, r=..., name=<ssa_name 0xfaa81658 30>, l=0xfaa84ee0,
phi=0xf9868e70, src=...) at
/vol/gcc/src/hg/master/local/gcc/gimple-range-fold.h:108
#12 0x019bf1f4 in fold_using_range::range_of_phi (this=<optimized out>, r=...,
phi=0xf9868e70, src=...) at
/vol/gcc/src/hg/master/local/gcc/gimple-range-fold.cc:820
#13 0x019c2630 in fold_using_range::fold_stmt (this=0xffbfc96f, r=...,
s=<gimple_phi 0xf9868e70>, src=..., name=<ssa_name 0xfaa81658 30>) at
/vol/gcc/src/hg/master/local/gcc/gimple-range-fold.cc:491
#14 0x019b0b6c in gimple_ranger::fold_range_internal (name=<ssa_name 0xfaa81658
30>, s=<gimple_phi 0xf9868e70>, r=..., this=0x27994c0) at
/vol/gcc/src/hg/master/local/gcc/gimple-range.cc:257
#15 gimple_ranger::range_of_stmt (this=0x27994c0, r=..., s=<gimple_phi
0xf9868e70>, name=<optimized out>) at
/vol/gcc/src/hg/master/local/gcc/gimple-range.cc:318
#16 0x019b0e14 in gimple_ranger::register_inferred_ranges (this=0x27994c0,
s=<gimple_phi 0xf9868e70>) at
/vol/gcc/src/hg/master/local/gcc/gimple-range.cc:474
#17 0x012ad20c in rvrp_folder::pre_fold_bb (this=0xffbfdd00, bb=<basic_block
0xfaaa98f0 (9)>) at /vol/gcc/src/hg/master/local/gcc/tree-vrp.cc:1045
#18 0x01168cd8 in substitute_and_fold_dom_walker::before_dom_children
(this=0xffbfdc50, bb=<basic_block 0xfaaa98f0 (9)>) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-propagate.cc:734
#19 0x01974970 in dom_walker::walk (this=0xffbfdc50, bb=<basic_block 0xfaaa98f0
(9)>) at /vol/gcc/src/hg/master/local/gcc/domwalk.cc:311
#20 0x011674b4 in substitute_and_fold_engine::substitute_and_fold
(this=0xffbfdd00, block=<optimized out>) at
/vol/gcc/src/hg/master/local/gcc/tree-ssa-propagate.cc:971
#21 0x012a9d98 in execute_ranger_vrp (fun=0xfa86a5b0,
warn_array_bounds_p=<optimized out>, final_p=<optimized out>) at
/vol/gcc/src/hg/master/local/gcc/tree-vrp.cc:1098
#22 0x00e04b8c in execute_one_pass (pass=<opt_pass* 0x2237d78 "evrp"(45)>) at
/vol/gcc/src/hg/master/local/gcc/passes.cc:2644
#23 0x00e055bc in execute_pass_list_1 (pass=<opt_pass* 0x2237d78 "evrp"(45)>)
at /vol/gcc/src/hg/master/local/gcc/passes.cc:2753
#24 0x00e055e0 in execute_pass_list_1 (pass=<opt_pass* 0x2237b20
"early_optimizations"(37)>) at /vol/gcc/src/hg/master/local/gcc/passes.cc:2754
#25 0x00e05634 in execute_pass_list (fn=0xfa86a5b0, pass=<opt_pass* 0x22379c8
"fixup_cfg"(34)>) at /vol/gcc/src/hg/master/local/gcc/passes.cc:2764
#26 0x00e061f8 in do_per_function_toporder (callback=0xe05614
<execute_pass_list(function*, opt_pass*)>, data=0x22379c8) at
/vol/gcc/src/hg/master/local/gcc/passes.cc:1780
#27 0x00e064a0 in do_per_function_toporder (data=<optimized out>,
callback=0xe05614 <execute_pass_list(function*, opt_pass*)>) at
/vol/gcc/src/hg/master/local/gcc/passes.cc:1747
#28 execute_ipa_pass_list (pass=<opt_pass* 0x2237988 "opt_local_passes"(33)>)
at /vol/gcc/src/hg/master/local/gcc/passes.cc:3098
#29 0x0097602c in ipa_passes () at
/vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:2203
#30 symbol_table::compile (this=0xfa812000) at
/vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:2324
#31 0x009799c0 in symbol_table::compile (this=0xfa812000) at
/vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:2304
#32 symbol_table::finalize_compilation_unit (this=0xfa812000) at
/vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:2576
#33 0x00f260a4 in compile_file () at
/vol/gcc/src/hg/master/local/gcc/toplev.cc:471
#34 0x00f29d18 in do_compile (no_backend=false) at
/vol/gcc/src/hg/master/local/gcc/toplev.cc:2125
#35 toplev::main (this=<optimized out>, argc=<optimized out>, argv=<optimized
out>) at /vol/gcc/src/hg/master/local/gcc/toplev.cc:2277
#36 0x01c29fc8 in main (argc=41, argv=0xffbfe25c) at
/vol/gcc/src/hg/master/local/gcc/main.cc:39

i.e. a NULL pointer dereference.  The go1 invocation is

go1 $srcdir/libgo/go/strconv/atob.go $srcdir/libgo/go/strconv/atoc.go
$srcdir/libgo/go/strconv/atof.go $srcdir/libgo/go/strconv/atoi.go
$srcdir/libgo/go/strconv/bytealg.go $srcdir/libgo/go/strconv/ctoa.go
$srcdir/libgo/go/strconv/decimal.go $srcdir/libgo/go/strconv/doc.go
$srcdir/libgo/go/strconv/eisel_lemire.go $srcdir/libgo/go/strconv/ftoa.go
$srcdir/libgo/go/strconv/ftoaryu.go $srcdir/libgo/go/strconv/isprint.go
$srcdir/libgo/go/strconv/itoa.go $srcdir/libgo/go/strconv/quote.go -mptr64
-mstack-bias -mno-v8plus -quiet -m64 -mcpu=v9 -g -O2 -version -fchecking=1
-fgo-pkgpath=strconv -fPIC -I . -L$objdir/./gcc/sparcv9 -L/lib/sparcv9
-L/usr/lib/sparcv9 -L$objdir/./gcc -o strconv.s

This is no doubt to either or both of

commit 4798080d4a3530d985efef68aa2e04ec7549b3c1
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Thu Dec 22 02:14:06 2022 +0000

    Add c[lt]z idiom recognition

commit d347fbf774dc50bf7511f4dc6bc74547ed364995
Author: Andrew Carlotti <andrew.carlotti@arm.com>
Date:   Thu Nov 10 15:56:51 2022 +0000

    Add cltz_complement idiom recognition

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-01-17 17:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 21:56 [Bug tree-optimization/108426] New: [13 regression] SEGV in contains_struct_check ro at gcc dot gnu.org
2023-01-16 21:57 ` [Bug tree-optimization/108426] " ro at gcc dot gnu.org
2023-01-16 22:02 ` pinskia at gcc dot gnu.org
2023-01-16 22:06 ` [Bug go/108426] " pinskia at gcc dot gnu.org
2023-01-16 22:07 ` pinskia at gcc dot gnu.org
2023-01-17  2:49 ` ian at airs dot com
2023-01-17  7:08 ` rguenth at gcc dot gnu.org
2023-01-17  8:16 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-01-17 17:05 ` cvs-commit at gcc dot gnu.org
2023-01-17 17:06 ` ian at airs dot com
2023-01-17 17:06 ` ian at airs dot com
2023-01-17 17:11 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).