An ICE in emit_move_insn_1()

Martin Dorey MDorey@Madge.com
Fri Nov 6 03:42:00 GMT 1998


I later found another ICE which could be fixed in expr.c in the same way.
Again, I don't know if this is the right thing to do.

Here's the completed report and patch:

struct RAM
{
	int spare [3];
};

void Call (int) {}

void monk ()
{
	int i = 0;
	(*(RAM*)0).spare [i] = 0; // ICE 1
	Call ((*(RAM*)0).spare [i]); // ICE 2
}

Index: expr.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/expr.c,v
retrieving revision 1.107
diff -c -3 -p -r1.107 expr.c
*** expr.c	1998/10/28 10:30:46	1.107
--- expr.c	1998/11/06 10:43:40
*************** expand_assignment (to, from, want_value,
*** 3270,3276 ****
  	        to_rtx = temp;
  	      else
  		to_rtx = change_address (to_rtx, mode1,
! 				         force_reg (GET_MODE (XEXP (temp,
0)),
  						    XEXP (temp, 0)));
  	      bitpos = 0;
  	    }
--- 3270,3276 ----
  	        to_rtx = temp;
  	      else
  		to_rtx = change_address (to_rtx, mode1,
! 				         force_reg (GET_MODE (XEXP (temp,
0)) == VOIDmode ? mode1 : GET_MODE (XEXP (temp, 0)),
  						    XEXP (temp, 0)));
  	      bitpos = 0;
  	    }
*************** expand_expr (exp, target, tmode, modifie
*** 6414,6420 ****
  		  op0 = temp;
  		else
  		  op0 = change_address (op0, mode1,
! 					force_reg (GET_MODE (XEXP (temp,
0)),
  						   XEXP (temp, 0)));
  		bitpos = 0;
  	      }
--- 6414,6420 ----
  		  op0 = temp;
  		else
  		  op0 = change_address (op0, mode1,
! 				        force_reg (GET_MODE (XEXP (temp, 0))
== VOIDmode ? mode1 : GET_MODE (XEXP (temp, 0)),
  						   XEXP (temp, 0)));
  		bitpos = 0;
  	      }

Specs:

~ $ ~/download/egcs/bin/gcc -v --save-temps -c monk.cpp
Reading specs from
/home/martindo/download/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.17/spec
s
gcc version egcs-2.92.17 19981029 (gcc2 ss-980609 experimental)
 /home/martindo/download/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.17/cpp
-lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=92 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__
-D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686
-D__i686__ -D__pentiumpro -D__pentiumpro__ monk.cpp monk.ii
GNU CPP version egcs-2.92.17 19981029 (gcc2 ss-980609 experimental) (i386
Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /home/martindo/download/egcs/include
 /home/martindo/download/egcs/i686-pc-linux-gnu/include
 
/home/martindo/download/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.17/incl
ude
 /usr/include
End of search list.
 
/home/martindo/download/egcs/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.92.17/cc1p
lus monk.ii -quiet -dumpbase monk.cc -version -o monk.s
GNU C++ version egcs-2.92.17 19981029 (gcc2 ss-980609 experimental)
(i686-pc-linux-gnu) compiled by GNU C version 2.7.2.3.
gcc: Internal compiler error: program cc1plus got fatal signal 5
~ $ 

-- 




More information about the Gcc-bugs mailing list