optimization bug

Weiwen Liu liu@hepvms.physics.yale.edu
Sun Sep 21 18:07:00 GMT 1997


Hi, 
I reported the following bug in a previous email which is attached below.

I found that the bug is due to replace a register in a USE RTL with
its value.

The following patch will disable replacing a register in a USE.

Weiwen

Sun Sep 21 18:17:24 1997  Weiwen Liu <liu@hepunix.physics.yale.edu>
	* local-alloc.c (update_equiv_regs): Forbids replacing a register
	  in a USE RTL.

*** local-alloc.c.~1~	Tue Sep  2 17:40:31 1997
--- local-alloc.c	Sun Sep 21 18:17:24 1997
*************** update_equiv_regs ()
*** 1227,1232 ****
--- 1227,1234 ----
        for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
  	{
  	  if (REG_NOTE_KIND (link) == REG_DEAD
+               /* Do not replace register in USE */
+               && GET_CODE(PATTERN(insn)) != USE
  	      /* Make sure this insn still refers to the register.  */
  	      && reg_mentioned_p (XEXP (link, 0), PATTERN (insn)))
  	    {


The previous message:
Hi,

On alpha-dec-osf4.0, egcs-2.90.08 970917 fails to compile the following
program with -O2 or -O3, but succeeds with -O1. 
The error message:
gcc: Internal compiler error: program cc1 got fatal signal 11

Weiwen

/* tmp.i */
enum Lisp_Type
{
  Lisp_Int                     
  ,Lisp_Record                 
  ,Lisp_Cons                   
  ,Lisp_String                 
  ,Lisp_Vector                 
  ,Lisp_Symbol
  ,Lisp_Char			 
};
typedef
union Lisp_Object
{
    struct
    {
	unsigned long  type_mark: 3L  + 1;
	signed long  val: (((8 * 8 ) )-((3L )+1L)) ;
    } s;
    struct
    {
        enum Lisp_Type type: 3L ;
	unsigned long  markbit: 1;
	unsigned long  val: (((8 * 8 ) )-((3L )+1L)) ;
    } gu;
    long  i;
    struct __nosuchstruct__ *v;
    struct __nosuchstruct__ *cv;              
}
Lisp_Object;
extern Lisp_Object pure[]; 
int
purified (Lisp_Object obj)
{
    if (! (( ((enum Lisp_Type) (  obj  ).gu.type)   ) != Lisp_Int
           && ( ((enum Lisp_Type) (  obj  ).gu.type)   ) != Lisp_Char) )
        return (0);
    return (((unsigned long ) ( ((void *) (( obj ).gu.val))  )
             <	(unsigned long ) (((unsigned char *) pure)
                                  + ((((1400000 ) + (43000 ) + (43000 )
                                       + (4000 ) + (4000 ) + (95000 )
                                       + (99000) + (100000 )) )) )
             &&	(unsigned long ) ( ((void *) (( obj ).gu.val))  )
             >=	(unsigned long ) ((unsigned char *) pure) ) );
}







More information about the Gcc-bugs mailing list