addressof and alpha_expand_block_move

Jeffrey A Law law@cygnus.com
Sat Jan 24 13:53:00 GMT 1998


  In message < 199801221959.LAA25910@kankakee.wrs.com >you write:
  > > Date: Tue, 20 Jan 1998 16:56:16 -0800
  > > From: Richard Henderson <rth@cygnus.com>
  > > To: egcs@cygnus.com
  > 
  > > Tue Jan 20 16:43:49 1998  Richard Henderson   <rth@cygnus.com>
  > 
  > > 	* alpha.h (GO_IF_LEGITIMATE_SIMPLE_ADDRESS): Allow addressof
  > > 	where we would accept a reg.
  > 
  > > ! #define GO_IF_LEGITIMATE_SIMPLE_ADDRESS(MODE, X, ADDR)	\
  > 
  > > !   /* Accept addressof since it will eventually become	\
  > > !      a register or an offset of the FP.  */		\
  > > !   if (GET_CODE (X) == ADDRESSOF)			\
  > > !     goto ADDR;						\
  > 
  > > !   if (GET_CODE (X) == PLUS				\
  > > !       && ((REG_P (XEXP (X, 0))				\
  > > !            && REG_OK_FOR_BASE_P (XEXP (X, 0))		\
  > > !            && CONSTANT_ADDRESS_P (XEXP (X, 1)))		\
  > > ! 	  || GET_CODE (XEXP (X, 0)) == ADDRESSOF))	\
  > > !     goto ADDR;						\
  > 
  > I can help but wonder if there are machine independent semantics that
  > we can put in that will apply to existing GO_IF_LEGITIMATE_ADDRESSes
  > that render your alpha.h change unnecessary...  It seems unclean to
  > have to embed knowledge of address-of into the file in this way.
While I agree that it's unclean to have ADDRESSOF bleed into the target
files, I don't see that there's any machine independent semantics we can
use.

ie, what happens if the expansion of ADDRESSOF creates an invalid address --
like a base + const_int, where the const_int won't fit into the range allowed
on the target (which can be quite small in some cases).


jeff



More information about the Gcc mailing list