[Issue 1035] New: regression: SIGSEGV at gcc/predict.c:1341

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 7 15:08:15 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1035

           Summary: regression: SIGSEGV at gcc/predict.c:1341
           Product: DGCC aka GDC
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: glue layer
        AssignedTo: dvdfrdmn at users.sf.net
        ReportedBy: thomas-dloop at kuehne.cn


# int status;
# 
# auto class AutoClass{
#    ~this(){
#       assert(status==0);
#       status--;
#       throw new Exception("error msg");
#    }
# }
# 
# void test(){
#    assert(status==0);
#    auto AutoClass ac = new AutoClass();
# }
# 
# int main(){
#    try{
#       test();
#    }catch{
#    }
#    
#    if(status==-1){
#       return 0;
#    }
#    assert(0);
# }

Compiling  with -O -inline causes the following segfault:

Starting program: 
/opt/gdc/gdc-0.23/libexec/gcc/x86_64-unknown-linux-gnu/4.1.1/cc1d -m32 -finline 
-O3 run/auto_03.d
 _dtor test main
Analyzing compilation unitPerforming intraprocedural optimizations
Assembling functions:
 test _dtor main
Program received signal SIGSEGV, Segmentation fault.
0x00000000007bc955 in tree_estimate_probability () at 
../../gcc-4.1.1/gcc/predict.c:1341
1341              if (e->dest == EXIT_BLOCK_PTR
(gdb) bt
#0  0x00000000007bc955 in tree_estimate_probability () at 
../../gcc-4.1.1/gcc/predict.c:1341
#1  0x00000000008608ea in execute_one_pass (pass=0xce12e0) at 
../../gcc-4.1.1/gcc/passes.c:827
#2  0x00000000008609a9 in execute_pass_list (pass=0xce12e0) at 
../../gcc-4.1.1/gcc/passes.c:859
#3  0x00000000008609c7 in execute_pass_list (pass=0xcdebe0) at 
../../gcc-4.1.1/gcc/passes.c:860
#4  0x0000000000505459 in tree_rest_of_compilation (fndecl=0x2ba16779d400) at 
../../gcc-4.1.1/gcc/tree-optimize.c:419
#5  0x00000000004bc28e in d_expand_function (fndecl=0x2ba16779d400) at 
../../gcc-4.1.1/gcc/d/d-lang.cc:1744
#6  0x00000000008b55cd in cgraph_expand_function (node=0x2ba16779e420) at 
../../gcc-4.1.1/gcc/cgraphunit.c:1055
#7  0x00000000008b5795 in cgraph_expand_all_functions () at 
../../gcc-4.1.1/gcc/cgraphunit.c:1121
#8  0x00000000008b5d1f in cgraph_optimize () at 
../../gcc-4.1.1/gcc/cgraphunit.c:1278
#9  0x00000000004bc1dc in d_write_global_declarations () at 
../../gcc-4.1.1/gcc/d/d-lang.cc:783
#10 0x0000000000833c27 in compile_file () at ../../gcc-4.1.1/gcc/toplev.c:1004
#11 0x000000000083553d in do_compile () at ../../gcc-4.1.1/gcc/toplev.c:1949
#12 0x00000000008355a1 in toplev_main (argc=5, argv=0x7fff43cbdb98) at 
../../gcc-4.1.1/gcc/toplev.c:1981
#13 0x000000000050121b in main (argc=5, argv=0x7fff43cbdb98) at 
../../gcc-4.1.1/gcc/main.c:35

test case:
http://dstress.kuehne.cn/run/auto_03.d


-- 



More information about the D.gnu mailing list