This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Recent change to mips_output_move


> 
> The patch below makes the test case pass.  It's just a proof of concept,
> I'm not sure whether it's right (or the best fix).
> 

It looks like the right fix to me, but that's such an obnoxiously
convoluted test...

If this does go in we should probably document that test in the bits
above with a "This checks: 1) 2) 3)... in order" :)

-eric

> Richard
> 
> 
> Index: expr.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/expr.c,v
> retrieving revision 1.544
> diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.544 expr.c
> *** expr.c	30 May 2003 17:49:44 -0000	1.544
> --- expr.c	3 Jun 2003 19:18:34 -0000
> *************** convert_modes (mode, oldmode, x, unsigne
> *** 1403,1415 ****
>   	  && GET_MODE_CLASS (oldmode) == MODE_INT
>   	  && (GET_CODE (x) == CONST_DOUBLE
>   	      || (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (oldmode)
>   		  && ((GET_CODE (x) == MEM && ! MEM_VOLATILE_P (x)
>   		       && direct_load[(int) mode])
>   		      || (GET_CODE (x) == REG
>   			  && (! HARD_REGISTER_P (x)
> ! 			      || HARD_REGNO_MODE_OK (REGNO (x), mode))
> ! 			  && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
> ! 						    GET_MODE_BITSIZE (GET_MODE (x)))))))))
>       {
>         /* ?? If we don't know OLDMODE, we have to assume here that
>   	 X does not need sign- or zero-extension.   This may not be
> --- 1403,1415 ----
>   	  && GET_MODE_CLASS (oldmode) == MODE_INT
>   	  && (GET_CODE (x) == CONST_DOUBLE
>   	      || (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (oldmode)
> + 		  && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
> + 					    GET_MODE_BITSIZE (GET_MODE (x)))
>   		  && ((GET_CODE (x) == MEM && ! MEM_VOLATILE_P (x)
>   		       && direct_load[(int) mode])
>   		      || (GET_CODE (x) == REG
>   			  && (! HARD_REGISTER_P (x)
> ! 			      || HARD_REGNO_MODE_OK (REGNO (x), mode))))))))
>       {
>         /* ?? If we don't know OLDMODE, we have to assume here that
>   	 X does not need sign- or zero-extension.   This may not be
-- 
Eric Christopher <echristo@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]