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]

m68k.c compile fix


On Mon, Jul 16, 2001 at 11:40:23PM -0700, Richard Henderson wrote:
> PS: m68k seems to be having issues with "targetm = TARGET_INITIALIZER"
> at the moment, so cc1 won't even build.  I guess I'll look at that too...

The expr.h include gets the declarations that target-def.h wants.
I wonder if we shouldn't move these default function declarations
to target.h instead?

The reload.h include gets some other missing declaration warnings.

The print_operand_address change cures some printf format warnings
when cross-compiling from alpha.

Tested via "make cc1".


r~


        * config/m68k/m68k.c: Include expr.h and reload.h.
        (print_operand_address) [16 bit int]: Cast INTVAL to int for %d.
        [general int]: Use HOST_WIDE_INT_PRINT_DEC.

Index: config/m68k/m68k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.c,v
retrieving revision 1.47
diff -c -p -d -r1.47 m68k.c
*** m68k.c	2001/07/07 01:07:20	1.47
--- m68k.c	2001/07/17 06:51:29
*************** Boston, MA 02111-1307, USA.  */
*** 33,38 ****
--- 33,40 ----
  #include "insn-attr.h"
  #include "recog.h"
  #include "toplev.h"
+ #include "expr.h"
+ #include "reload.h"
  #include "tm_p.h"
  #include "target.h"
  #include "target-def.h"
*************** print_operand_address (file, addr)
*** 3828,3850 ****
  #ifdef MOTOROLA
  #ifdef SGS
  	    /* Many SGS assemblers croak on size specifiers for constants. */
! 	    fprintf (file, "%d", INTVAL (addr));
  #else
! 	    fprintf (file, "%d.w", INTVAL (addr));
  #endif
  #else
! 	    fprintf (file, "%d:w", INTVAL (addr));
  #endif
  	  }
  	else if (GET_CODE (addr) == CONST_INT)
  	  {
! 	    fprintf (file,
! #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
! 		     "%d",
! #else
! 		     "%ld",
! #endif
! 		     INTVAL (addr));
  	  }
  	else if (TARGET_PCREL)
  	  {
--- 3830,3846 ----
  #ifdef MOTOROLA
  #ifdef SGS
  	    /* Many SGS assemblers croak on size specifiers for constants. */
! 	    fprintf (file, "%d", (int) INTVAL (addr));
  #else
! 	    fprintf (file, "%d.w", (int) INTVAL (addr));
  #endif
  #else
! 	    fprintf (file, "%d:w", (int) INTVAL (addr));
  #endif
  	  }
  	else if (GET_CODE (addr) == CONST_INT)
  	  {
! 	    fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (addr));
  	  }
  	else if (TARGET_PCREL)
  	  {


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