[gnu.gcc.bug] Faulty bug report

hve@UUNET.UU.NET (H.v.Eicken) (04/03/89)

Dear Reader,
		I am using a VAXstation 2000 running ULTRIX. I have the
GNU C-compiler distribution "gcc-1.33".

I am trying to install the compiler as a cross compiler on my VAXstation. 
It should compile for a MC 68030 based system with a MC 68882. 
I am using tm-sun3.h to get started. 

I found the following problem:

    The ULTRIX C-compiler was unable to compile the code generated by the
    GO_IF_LEGITIMATE_ADDRESS macro. It ran out of tree space and requested
    to simplify the expression. My way out was to change two macros called
    by the above macro into functions.

Please disregard my previous mail reporting a signal 4 from cc1. This was
caused by cc1 calling abort(). This was due to my faulty set of replacement
functions. Everything is now working fine.

Ciao
	Horst von Eicken

------------------ these are the replacement functions -----------------------

/* This is a small C package to overcome a problem with ULTRIX CC */

/* H. v. Eicken */

#include "config.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
#include "expr.h"


LEGITIMATE_INDEX_REG_P(X)
  rtx   X;
{
  if( ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X))
      || (GET_CODE (X) == SIGN_EXTEND
	  && GET_CODE (XEXP (X, 0)) == REG
	  && GET_MODE (XEXP (X, 0)) == HImode
	  && REG_OK_FOR_INDEX_P (XEXP (X, 0))))
    ) return(1);
  else return(0);
}

LEGITIMATE_INDEX_P(X)
  rtx   X;
{
  if(  LEGITIMATE_INDEX_REG_P (X)
       || (TARGET_68020 && GET_CODE (X) == MULT
	   && LEGITIMATE_INDEX_REG_P (XEXP (X, 0))
	   && GET_CODE (XEXP (X, 1)) == CONST_INT
	   && (INTVAL (XEXP (X, 1)) == 2
	       || INTVAL (XEXP (X, 1)) == 4
	       || INTVAL (XEXP (X, 1)) == 8))
    ) return(1);
  else return(0);
}

------------------ end of replacement functions ----------------------------