Command line: $ gcc -O[123s] testcase.c Compiler output: $ gcc -O testcase.c testcase.c: In function 'foo': testcase.c:7:7: internal compiler error: RTL check: expected code 'mem', have 'reg' in emit_block_move_hints, at expr.c:1189 Unreduced testcase crashes with: $ gcc -O rarpd.i rarpd.c: In function 'load_if': rarpd.c:203:41: internal compiler error: in make_decl_rtl, at varasm.c:1346 Reduced testcase without rtl checking crashes with: $ gcc -O testcase.c testcase.c: In function 'foo': testcase.c:7:7: internal compiler error: Segmentation fault Tested revisions: r162193 - crash r162056 - crash r161659 - crash r161170 - OK
Created attachment 21204 [details] reduced testcase (from iptraf sources) Command line: $ gcc -O pr44941.c
It is caused by revision 161655: http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00006.html
Mine.
#3 0x000000000060425e in store_one_arg (arg=0x7fffffffbc10, argblock=0x7ffff7ee0540, flags=0, variable_size=0, reg_parm_stack_space=0) at /space/rguenther/src/svn/trunk/gcc/calls.c:4309 4309 emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx, (gdb) call debug_rtx (arg->value) (reg:SI 61) (gdb) p arg->mode $2 = BLKmode (gdb) call debug_rtx (size_rtx) (const_int 0 [0]) (gdb) call debug_tree (arg->tree_value) <mem_ref 0x7ffff7ff90a8 type <record_type 0x7ffff5ae02a0 S type_0 BLK size <integer_cst 0x7ffff7ed2b18 constant 0> unit size <integer_cst 0x7ffff7ed2410 constant 0> align 8 symtab 0 alias set -1 canonical type 0x7ffff5ae02a0 context <translation_unit_decl 0x7ffff7efb958 D.1621> pointer_to_this <pointer_type 0x7ffff5ae0498> chain <type_decl 0x7ffff7efb8a0 D.1615>> arg 0 <addr_expr 0x7ffff5b43030 type <pointer_type 0x7ffff7ef6540 type <integer_type 0x7ffff7ee7498 int> unsigned DI size <integer_cst 0x7ffff7ed27a8 constant 64> unit size <integer_cst 0x7ffff7ed27d0 constant 8> align 64 symtab 0 alias set -1 canonical type 0x7ffff7ef6540> arg 0 <parm_decl 0x7ffff7edb908 i type <integer_type 0x7ffff7ee7498 int> used SI file pr44941.c line 5 col 15 size <integer_cst 0x7ffff7ed26e0 constant 32> unit size <integer_cst 0x7ffff7ed23e8 constant 4> align 32 context <function_decl 0x7ffff5afb100 foo> (reg/v:SI 58 [ i ]) arg-type <integer_type 0x7ffff7ee7498 int> incoming-rtl (reg:SI 5 di [ i ])> pr44941.c:7:21> arg 1 <integer_cst 0x7ffff5adc668 type <pointer_type 0x7ffff5ae0498> constant 0> pr44941.c:7:7> I have a patch.
Thank you for fixing this. It seems the original ICE (in make_decl_rtl, at varasm.c:1346) is different, so I opened it as PR44988.
Subject: Bug 44941 Author: rguenth Date: Mon Jul 19 15:39:51 2010 New Revision: 162308 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162308 Log: 2010-07-19 Richard Guenther <rguenther@suse.de> PR middle-end/44941 * expr.c (emit_block_move_hints): Move zero size check first. Move asserts to more useful places. * calls.c (load_register_parameters): Check for zero size. * gcc.c-torture/compile/pr44941.c: New testcase. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr44941.c Modified: trunk/gcc/ChangeLog trunk/gcc/calls.c trunk/gcc/expr.c trunk/gcc/testsuite/ChangeLog
Fixed.