www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 1031] New: regression: SIGSEGV at expr.c:6498

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1031

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


# size_t intRes(){
#    return 4;
# }
# 
# static const char[] foo = "abc123";
# 
# int main(){
#    char c = foo[intRes() % $];
# 
#    if(c != '2'){
#       assert(0);
#    }
# 
#    return 0;
# }

Starting program: 
/opt/gdc/gdc-0.23/libexec/gcc/x86_64-unknown-linux-gnu/4.1.1/cc1d -m32 
run/l/length_10_A.d
 intRes main
Program received signal SIGSEGV, Segmentation fault.
0x00000000005fd3c5 in expand_expr_real (exp=0x0, target=0x0, tmode=VOIDmode, 
modifier=EXPAND_WRITE, alt_rtl=0x0)
    at ../../gcc-4.1.1/gcc/expr.c:6498
6498      if (TREE_CODE (exp) == ERROR_MARK
(gdb) bt
#0  0x00000000005fd3c5 in expand_expr_real (exp=0x0, target=0x0, 
tmode=VOIDmode, modifier=EXPAND_WRITE, alt_rtl=0x0)
    at ../../gcc-4.1.1/gcc/expr.c:6498
#1  0x00000000005f1988 in expand_expr (exp=0x0, target=0x0, mode=VOIDmode, 
modifier=EXPAND_WRITE)
    at ../../gcc-4.1.1/gcc/expr.h:493
#2  0x00000000005fe517 in expand_expr_real_1 (exp=0x2b09b6fac960, target=0x0, 
tmode=VOIDmode, modifier=EXPAND_WRITE, 
    alt_rtl=0x0) at ../../gcc-4.1.1/gcc/expr.c:6799
#3  0x00000000005fd5ae in expand_expr_real (exp=0x2b09b6fac960, target=0x0, 
tmode=VOIDmode, modifier=EXPAND_WRITE, 
    alt_rtl=0x0) at ../../gcc-4.1.1/gcc/expr.c:6536
#4  0x00000000005f1988 in expand_expr (exp=0x2b09b6fac960, target=0x0, 
mode=VOIDmode, modifier=EXPAND_WRITE)
    at ../../gcc-4.1.1/gcc/expr.h:493
#5  0x00000000005f7a09 in expand_assignment (to=0x2b09b6fac960, 
from=0x2b09b704c690) at ../../gcc-4.1.1/gcc/expr.c:4075
#6  0x000000000060368d in expand_expr_real_1 (exp=0x2b09b6fabd70, target=0x0, 
tmode=VOIDmode, modifier=EXPAND_NORMAL, 
    alt_rtl=0x0) at ../../gcc-4.1.1/gcc/expr.c:8411
#7  0x00000000005fd578 in expand_expr_real (exp=0x2b09b6fabd70, 
target=0x2b09b6faa400, tmode=VOIDmode, 
    modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../gcc-4.1.1/gcc/expr.c:6530
#8  0x0000000000825e39 in expand_expr (exp=0x2b09b6fabd70, 
target=0x2b09b6faa400, mode=VOIDmode, modifier=EXPAND_NORMAL)
    at ../../gcc-4.1.1/gcc/expr.h:493
#9  0x0000000000828e04 in expand_expr_stmt (exp=0x2b09b6fabd70) at 
../../gcc-4.1.1/gcc/stmt.c:1357
#10 0x00000000008640e1 in expand_gimple_basic_block (bb=0x2b09b7051500, 
dump_file=0x0) at ../../gcc-4.1.1/gcc/cfgexpand.c:1365
#11 0x0000000000864d11 in tree_expand_cfg () at 
../../gcc-4.1.1/gcc/cfgexpand.c:1624
#12 0x00000000008608ea in execute_one_pass (pass=0xce1e60) at 
../../gcc-4.1.1/gcc/passes.c:827
#13 0x00000000008609a9 in execute_pass_list (pass=0xce1e60) at 
../../gcc-4.1.1/gcc/passes.c:859
#14 0x0000000000505459 in tree_rest_of_compilation (fndecl=0x2b09b7049a00) at 
../../gcc-4.1.1/gcc/tree-optimize.c:419
#15 0x00000000004bc28e in d_expand_function (fndecl=0x2b09b7049a00) at 
../../gcc-4.1.1/gcc/d/d-lang.cc:1744
#16 0x00000000008b55cd in cgraph_expand_function (node=0x2b09b70572c0) at 
../../gcc-4.1.1/gcc/cgraphunit.c:1055
#17 0x00000000008b3ccf in cgraph_assemble_pending_functions () at 
../../gcc-4.1.1/gcc/cgraphunit.c:352
#18 0x00000000008b3f3e in cgraph_finalize_function (decl=0x2b09b7049a00, 
nested=0 '\0')
    at ../../gcc-4.1.1/gcc/cgraphunit.c:455
#19 0x00000000004c9d0d in ObjectFile::outputFunction (f=0xe01eb0) at 
../../gcc-4.1.1/gcc/d/d-objfile.cc:393
#20 0x00000000004d0505 in FuncDeclaration::toObjFile (this=0xe01eb0) at 
../../gcc-4.1.1/gcc/d/d-glue.cc:2533
#21 0x00000000004cecc2 in Module::genobjfile (this=0xd7d7c0) at 
../../gcc-4.1.1/gcc/d/d-glue.cc:2566
#22 0x00000000004be23c in d_parse_file () at 
../../gcc-4.1.1/gcc/d/d-lang.cc:1088
#23 0x0000000000833bf2 in compile_file () at ../../gcc-4.1.1/gcc/toplev.c:991
#24 0x000000000083553d in do_compile () at ../../gcc-4.1.1/gcc/toplev.c:1949
#25 0x00000000008355a1 in toplev_main (argc=3, argv=0x7ffff42eca68) at 
../../gcc-4.1.1/gcc/toplev.c:1981
#26 0x000000000050121b in main (argc=3, argv=0x7ffff42eca68) at 
../../gcc-4.1.1/gcc/main.c:35

test cases:
http://dstress.kuehne.cn/run/l/length_10_A.d
http://dstress.kuehne.cn/run/l/length_10_B.d
http://dstress.kuehne.cn/run/l/length_10_C.d


-- 
Mar 07 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1031


braddr puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression




-- 
Apr 13 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1031


dvdfrdmn users.sf.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from dvdfrdmn users.sf.net  2007-07-14 08:58 -------
Fixed in release svn r126 / release 0.24


-- 
Jul 14 2007