[m68k]: patch to fix m68k_output_mi_thunk() for ColdFire

Andreas Schwab schwab@suse.de
Thu May 27 09:27:00 GMT 2004


Peter Barada <peter@the-baradas.com> writes:

> Index: gcc/config/m68k/m68k.c
> ===================================================================
> RCS file: /cvs/uberbaum/gcc/config/m68k/m68k.c,v
> retrieving revision 1.129
> diff -c -3 -p -r1.129 m68k.c
> *** gcc/config/m68k/m68k.c	10 Mar 2004 05:07:45 -0000	1.129
> --- gcc/config/m68k/m68k.c	26 May 2004 22:56:27 -0000
> *************** m68k_output_mi_thunk (FILE *file, tree t
> *** 3371,3376 ****
> --- 3371,3393 ----
>   			 "\tsubq.l %I%d,4(%Rsp)\n" :
>   			 "\tsubql %I%d,%Rsp@(4)\n",
>   		 (int) -delta);
> +   else if (TARGET_COLDFIRE)
> +     {
> +       /* ColdFire can't add/sub a constant to memory unless it ins
> + 	 the range of addq/subq.  So load the vlaue into %d0 and
> + 	 then add it to 4(%sp). */
> +       if (delta >= -128 && delta <= 127)
> + 	asm_fprintf (file, MOTOROLA ?
> + 		     "\tmoveq.l %I%wd,%Rd0\n" :
> + 		     "\tmoveql %I%wd,%Rd0\n", (int)delta);
> +       else
> + 	asm_fprintf (file, MOTOROLA ?
> + 		     "\tmove.l %I%wd,%Rd0\n" :
> + 		     "\tmovel %I%wd,%Rd0\n", (int)delta);

You are still having the broken casts here.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc mailing list