This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ crash on bad initializer
- From: Ken Raeburn <raeburn at MIT dot EDU>
- To: bug-gcc at gnu dot org
- Date: Tue, 03 Sep 2002 14:07:21 -0400
- Subject: g++ crash on bad initializer
struct flock {
int a, b, c;
};
int foo ()
{
static const struct flock f = 0; /* 7 */
return 37;
}
/*
% g++ -O -c foo.cc
foo.cc: In function `int foo()':
foo.cc:7: Internal compiler error in gen_lowpart, at emit-rtl.c:1197
%
gcc-3.2 on i686-pc-linux-gnu
#0 fancy_abort (file=0x36 <Address 0x36 out of bounds>, line=54, function=0x36 <Address 0x36 out of bounds>)
at diagnostic.c:1452
#1 0x08100d55 in gen_lowpart (mode=BLKmode, x=0x40014210) at emit-rtl.c:1197
else
>> abort ();
- x= const_int 0
#2 0x0811a01c in store_expr (exp=0x40023ce0, target=0x4003ae80, want_value=0) at expr.c:4110
if (CONSTANT_P (temp) && GET_MODE (temp) == VOIDmode
&& TREE_CODE (exp) != ERROR_MARK
&& GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
>> temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)),
temp, TREE_UNSIGNED (TREE_TYPE (exp)));
- exp= integer_cst 0
- target= (mem/s:BLK (symbol_ref:SI ("*_ZZ3foovE1f")) [0 f+0 S12 A32])
#3 0x08119461 in expand_assignment (to=0x4004f4d0, from=0x40023ce0, want_value=0, suggest_reg=1) at expr.c:3888
push_temp_slots ();
>>result = store_expr (from, to_rtx, want_value);
preserve_temp_slots (result);
- to= var_decl f record_type size=96
- from= integer_cst 0
#4 0x0811ee2d in expand_expr (exp=0x4004f4d0, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) at expr.c:8535
#5 0x0811edd1 in expand_expr (exp=0x4004f4d0, target=0x0, tmode=VOIDmode, modifier=EXPAND_NORMAL) at expr.c:8085
#6 0x0821c6f6 in expand_expr_stmt_value (exp=0x31, want_value=1073824272, maybe_last=54) at stmt.c:2247
#7 0x080cb033 in genrtl_expr_stmt_value (expr=0x4002ed20, want_value=0, maybe_last=1) at c-semantics.c:353
#8 0x080cb978 in expand_stmt (t=0x4002ed20) at c-semantics.c:786
#9 0x080cb98f in expand_stmt (t=0x40042dd4) at c-semantics.c:813
#10 0x080cb1cd in genrtl_if_stmt (t=0x4002ebe0) at c-semantics.c:407
#11 0x080cb9a3 in expand_stmt (t=0x4002eca0) at c-semantics.c:809
#12 0x080cb98f in expand_stmt (t=0x40042be0) at c-semantics.c:813
#13 0x080cb98f in expand_stmt (t=0x40042ba4) at c-semantics.c:813
#14 0x080b36ec in expand_body (fn=0x4004f3f0) at cp/semantics.c:2403
#15 0x08090507 in yyparse_1 () at parse.y:795
#16 0x082266f4 in compile_file () at toplev.c:2120
#17 0x0822b359 in do_compile () at toplev.c:5211
#18 0x0822b3c9 in toplev_main (argc=54, argv=0x0) at toplev.c:5243
#19 0x080cd56b in main (argc=54, argv=0x36) at main.c:35
#20 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
In frame 2, convert_modes is being passed BLKmode for the target, but
must get only floating or only integer modes. This results in
gen_lowpart being called with BLKmode, which it can't handle.
*/