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

            Bug ID: 78501
           Summary: [7 regression] SEGV in vrp_val_max
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: prathamesh3492 at gcc dot gnu.org
  Target Milestone: ---
              Host: *-*-solaris2.*
            Target: *-*-solaris2.*
             Build: *-*-solaris2.*

As of r242800, Ada bootstrap is broken on (at least) Solaris/x86 and SPARC: in 
stage2, I get

/var/gcc/regression/trunk/12-gcc/build/./prev-gcc/xgcc
-B/var/gcc/regression/trunk/12-gcc/build/./prev-gcc/
-B/vol/gcc/i386-pc-solaris2.12/bin/ -B/vol/gcc/i386-pc-solaris2.12/bin/
-B/vol/gcc/i386-pc-solaris2.12/lib/ -isystem
/vol/gcc/i386-pc-solaris2.12/include -isystem
/vol/gcc/i386-pc-solaris2.12/sys-include    -c -g -O2  -gnatpg -gnatwns -gnata
-W -Wall -nostdinc -I- -I. -Iada/generated -Iada
-I/vol/gcc/src/hg/trunk/local/gcc/ada
-I/vol/gcc/src/hg/trunk/local/gcc/ada/gcc-interface
/vol/gcc/src/hg/trunk/local/gcc/ada/osint.adb -o ada/osint.o

raised CONSTRAINT_ERROR : SIGSEGV
make: *** [ada/osint.o] Error 1

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x099519ac in vrp_val_max (type=0x0)
    at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:156
156       if (!INTEGRAL_TYPE_P (type))
(gdb) where
#0  0x099519ac in vrp_val_max (type=0x0)
    at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:156
#1  0x0995de5d in extract_range_basic (vr=0xfeffd164, stmt=0xfa517f24)
    at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:4033
#2  0x09967eb5 in vrp_visit_assignment_or_call (stmt=0xfa517f24, 
    output_p=0xfeffd194, vr=0xfeffd164)
    at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:7137
#3  0x09969b75 in extract_range_from_stmt (stmt=0xfa517f24, 
    taken_edge_p=0xfeffd174, output_p=0xfeffd194, vr=0xfeffd164)
    at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:7927
#4  0x099730f5 in evrp_dom_walker::before_dom_children (this=0xfeffd32c, 
    bb=0xfa5ec200) at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:10885
#5  0x09f71ed5 in dom_walker::walk (this=0xfeffd32c, bb=0xfa5ec200)
    at /vol/gcc/src/hg/trunk/local/gcc/domwalk.c:265
#6  0x09973dbe in execute_early_vrp ()
    at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:11109
#7  0x099743af in (anonymous namespace)::pass_early_vrp::execute (
    this=0xac86450) at /vol/gcc/src/hg/trunk/local/gcc/tree-vrp.c:11358
#8  0x09590d66 in execute_one_pass (pass=0xac86450)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2370
#9  0x095910a1 in execute_pass_list_1 (pass=0xac86450)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2459
#10 0x095910d1 in execute_pass_list_1 (pass=0xac86200)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2460
#11 0x0959111b in execute_pass_list (fn=0xfade9680, pass=0xac86100)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2470
#12 0x0958f713 in do_per_function_toporder (
    callback=0x95910e9 <execute_pass_list(function*, opt_pass*)>, 
    data=0xac86100) at /vol/gcc/src/hg/trunk/local/gcc/passes.c:1729
#13 0x09591c90 in execute_ipa_pass_list (pass=0xac860c0)
    at /vol/gcc/src/hg/trunk/local/gcc/passes.c:2812
#14 0x091ec739 in ipa_passes ()
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2286
#15 0x091ecb64 in symbol_table::compile (this=0xfac09000)
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2425
#16 0x091ed010 in symbol_table::finalize_compilation_unit (this=0xfac09000)
    at /vol/gcc/src/hg/trunk/local/gcc/cgraphunit.c:2584
#17 0x0968f70c in compile_file ()
    at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:488
#18 0x09691937 in do_compile ()
    at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:1983
#19 0x09691bf2 in toplev::main (this=0xfeffdafe, argc=34, argv=0xfeffdb54)
    at /vol/gcc/src/hg/trunk/local/gcc/toplev.c:2117
#20 0x0a09b44c in main (argc=34, argv=0xfeffdb54)
    at /vol/gcc/src/hg/trunk/local/gcc/main.c:39

This has obviously been introduced by

2016-11-23  Prathamesh Kulkarni  <prathamesh.kulka...@linaro.org>

        PR middle-end/78153
        * gimple-fold.c (fold_stmt_1): Handle case for GIMPLE_RETURN.
        * tree-vrp.c (extract_range_basic): Handle case for
        CFN_BUILT_IN_STRLEN.

  Rainer

Reply via email to