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

            Bug ID: 94239
           Summary: [10 regression] cc1 SEGV in
                    get_location_from_adhoc_loc with gcc.dg/pr20245-1.c
                    etc.
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
              Host: i386-pc-solaris2.11
            Target: i386-pc-solaris2.11
             Build: i386-pc-solaris2.11

Between 20200319 (f22712bd8a2ed57d3cc7e6fa92730bd5852e27b3) and 20200320
(719c864225e28c33a0737a331a772781ce8e6591), two tests regressed on Solaris
11/x86
(32-bit only):

+FAIL: gcc.dg/pr20245-1.c (internal compiler error)
+FAIL: gcc.dg/pr20245-1.c (test for excess errors)

Excess errors:
during GIMPLE pass: lower
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/pr20245-1.c:5:6: internal
compiler error: Segmentation Fault
0x91a511c crash_signal
        /vol/gcc/src/hg/master/local/gcc/toplev.c:328
0x9d33aa6 get_location_from_adhoc_loc(line_maps const*, unsigned int)
        /vol/gcc/src/hg/master/local/libcpp/line-map.c:257
0x9d33aa6 get_pure_location(line_maps*, unsigned int)
        /vol/gcc/src/hg/master/local/libcpp/line-map.c:323

+FAIL: gcc.dg/pr28419.c (internal compiler error)
+FAIL: gcc.dg/pr28419.c (test for excess errors)

Excess errors:
during GIMPLE pass: lower
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/pr28419.c:2:6: internal
compiler error: Segmentation Fault
0x91a511c crash_signal
        /vol/gcc/src/hg/master/local/gcc/toplev.c:328
0x9d33aa6 get_location_from_adhoc_loc(line_maps const*, unsigned int)
        /vol/gcc/src/hg/master/local/libcpp/line-map.c:257
0x9d33aa6 get_pure_location(line_maps*, unsigned int)
        /vol/gcc/src/hg/master/local/libcpp/line-map.c:323

The failure can be reproduced with

$ cc1 -fpreprocessed pr20245-1.i -quiet -o pr20245-1.s
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x09d33aa6 in get_location_from_adhoc_loc (loc=4264370176, set=0xfaefb000)
    at /vol/gcc/src/hg/master/local/libcpp/line-map.c:257
257       return set->location_adhoc_data_map.data[loc & MAX_LOCATION_T].locus;
(gdb) where
#0  0x09d33aa6 in get_location_from_adhoc_loc (loc=4264370176, set=0xfaefb000)
    at /vol/gcc/src/hg/master/local/libcpp/line-map.c:257
#1  get_pure_location (set=0xfaefb000, loc=4264370176)
    at /vol/gcc/src/hg/master/local/libcpp/line-map.c:323
#2  0x094c0da5 in get_pure_location (loc=4264370176)
    at /vol/gcc/src/hg/master/local/gcc/input.h:148
#3  set_block (loc=4264370176, block=<block 0xfa4a0000>)
    at /vol/gcc/src/hg/master/local/gcc/tree.c:14840
#4  0x09b634df in gimple_set_block (block=<optimized out>, g=
    <gimple_return 0xfa4967b0>)
    at /vol/gcc/src/hg/master/local/gcc/gimple.h:1865
#5  lower_function_body () at /vol/gcc/src/hg/master/local/gcc/gimple-low.c:136
#6  (anonymous namespace)::pass_lower_cf::execute (this=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/gimple-low.c:195
#7  0x090b5a1e in execute_one_pass (pass=<opt_pass* 0xa42d160 "lower"(13)>)
    at /vol/gcc/src/hg/master/local/gcc/passes.c:2502
#8  0x090b6385 in execute_pass_list_1 (pass=<opt_pass* 0xa42d160 "lower"(13)>, 
    pass@entry=<opt_pass* 0xa42d060 "*warn_unused_result"(-1)>)
    at /vol/gcc/src/hg/master/local/gcc/passes.c:2590
#9  0x090b63ce in execute_pass_list (fn=0xfa49f000, 
    pass=<opt_pass* 0xa42d060 "*warn_unused_result"(-1)>)
    at /vol/gcc/src/hg/master/local/gcc/passes.c:2601
#10 0x08cbbcfa in cgraph_node::analyze (this=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/context.h:48
#11 0x08cbea41 in analyze_functions (first_time=first_time@entry=true)
    at /vol/gcc/src/hg/master/local/gcc/cgraphunit.c:1227
#12 0x08cbf5a7 in symbol_table::finalize_compilation_unit (this=0xfa4080d0)
    at /vol/gcc/src/hg/master/local/gcc/cgraphunit.c:2973
#13 0x091a5571 in compile_file ()
    at /vol/gcc/src/hg/master/local/gcc/toplev.c:483
#14 0x091a7b9f in do_compile ()
    at /vol/gcc/src/hg/master/local/gcc/toplev.c:2273
#15 toplev::main (this=0xfeffd8de, argc=<optimized out>, argv=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/toplev.c:2412
#16 0x09cd6ae1 in main (argc=6, argv=0xfeffd944)
    at /vol/gcc/src/hg/master/local/gcc/main.c:39

Reply via email to