Bug 1035 – regression: SIGSEGV at gcc/predict.c:1341

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2007-03-07T17:08:00Z
Last change time
2015-06-09T01:31:14Z
Assigned to
dvdfrdmn
Creator
thomas-dloop

Comments

Comment #0 by thomas-dloop — 2007-03-07T17:08:05Z
# 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
Comment #1 by dvdfrdmn — 2007-07-19T22:13:05Z
Fixed in svn r130 / release 0.24 Fix is in the GCC patch, so re-apply it before rebuilding.