Commit 16f104b3 by Nick Clifton Committed by Nick Clifton

Fix compile time warnings

From-SVN: r43199
parent d4a6cf38
2001-06-11 Nick Clifton <nickc@cambridge.redhat.com>
* config/m32r/m32r.md (movstrsi_internal): Do not expect a
return string from m32r_output_block_move.
* config/m32r/m32r-protos.h: Make m32r_output_block_move a
void function.
* config/m32r/m32r.h (INT32_P): Rename to UNIT32_P and remove
integer overflow.
(ROUND_ADVANCE): Remove signed/unsigned conflict.
* config/m32r/m32r.c: Declare prototypes for static functions.
(move_src_operand): Replace INT32_P with UINT32_P.
(function_arg_partial_nregs): Fixed signed/unsigned conflict
in initialisation of 'size'.
(m32r_sched_reord): Remove redundant declarations of 'code'.
(m32r_output_block_move): Change to a void function.
(m32r_encode_section_info): Cast return of
TREE_STRING_POINTER to avoid compile time warning.
2001-06-11 Richard Henderson <rth@redhat.com> 2001-06-11 Richard Henderson <rth@redhat.com>
* config/alpha/osf5.h (TARGET_LD_BUGGY_LDGP): New. * config/alpha/osf5.h (TARGET_LD_BUGGY_LDGP): New.
......
/* Prototypes for m32r.c functions used in the md file & elsewhere. /* Prototypes for m32r.c functions used in the md file & elsewhere.
Copyright (C) 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -60,7 +60,7 @@ extern int m32r_address_code PARAMS ((rtx)); ...@@ -60,7 +60,7 @@ extern int m32r_address_code PARAMS ((rtx));
extern void m32r_initialize_trampoline PARAMS ((rtx, rtx, rtx)); extern void m32r_initialize_trampoline PARAMS ((rtx, rtx, rtx));
extern int zero_and_one PARAMS ((rtx, rtx)); extern int zero_and_one PARAMS ((rtx, rtx));
extern char * emit_cond_move PARAMS ((rtx *, rtx)); extern char * emit_cond_move PARAMS ((rtx *, rtx));
extern char * m32r_output_block_move PARAMS ((rtx, rtx *)); extern void m32r_output_block_move PARAMS ((rtx, rtx *));
extern void m32r_expand_block_move PARAMS ((rtx *)); extern void m32r_expand_block_move PARAMS ((rtx *));
extern void m32r_print_operand PARAMS ((FILE *, rtx, int)); extern void m32r_print_operand PARAMS ((FILE *, rtx, int));
extern void m32r_print_operand_address PARAMS ((FILE *, rtx)); extern void m32r_print_operand_address PARAMS ((FILE *, rtx));
......
/* Subroutines used for code generation on the Mitsubishi M32R cpu. /* Subroutines used for code generation on the Mitsubishi M32R cpu.
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h" #include "function.h"
#include "recog.h" #include "recog.h"
#include "toplev.h" #include "toplev.h"
#include "ggc.h"
#include "m32r-protos.h" #include "m32r-protos.h"
/* Save the operands last given to a compare for use when we /* Save the operands last given to a compare for use when we
...@@ -55,7 +56,9 @@ enum m32r_sdata m32r_sdata; ...@@ -55,7 +56,9 @@ enum m32r_sdata m32r_sdata;
int m32r_sched_odd_word_p; int m32r_sched_odd_word_p;
/* Forward declaration. */ /* Forward declaration. */
static void init_reg_tables PARAMS ((void)); static void init_reg_tables PARAMS ((void));
static void block_move_call PARAMS ((rtx, rtx, rtx));
static int m32r_is_insn PARAMS ((rtx));
/* Called by OVERRIDE_OPTIONS to initialize various things. */ /* Called by OVERRIDE_OPTIONS to initialize various things. */
...@@ -372,7 +375,7 @@ m32r_encode_section_info (decl) ...@@ -372,7 +375,7 @@ m32r_encode_section_info (decl)
if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd' if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd'
&& DECL_SECTION_NAME (decl) != NULL_TREE) && DECL_SECTION_NAME (decl) != NULL_TREE)
{ {
char *name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); char *name = (char *) TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
if (! strcmp (name, ".sdata") || ! strcmp (name, ".sbss")) if (! strcmp (name, ".sdata") || ! strcmp (name, ".sbss"))
{ {
#if 0 /* ??? There's no reason to disallow this, is there? */ #if 0 /* ??? There's no reason to disallow this, is there? */
...@@ -436,6 +439,7 @@ m32r_encode_section_info (decl) ...@@ -436,6 +439,7 @@ m32r_encode_section_info (decl)
const char *str = XSTR (XEXP (rtl, 0), 0); const char *str = XSTR (XEXP (rtl, 0), 0);
int len = strlen (str); int len = strlen (str);
char *newstr = ggc_alloc (len + 2); char *newstr = ggc_alloc (len + 2);
strcpy (newstr + 1, str); strcpy (newstr + 1, str);
*newstr = prefix; *newstr = prefix;
XSTR (XEXP (rtl, 0), 0) = newstr; XSTR (XEXP (rtl, 0), 0) = newstr;
...@@ -744,7 +748,7 @@ move_src_operand (op, mode) ...@@ -744,7 +748,7 @@ move_src_operand (op, mode)
loadable with one insn, and split the rest into two. The instances loadable with one insn, and split the rest into two. The instances
where this would help should be rare and the current way is where this would help should be rare and the current way is
simpler. */ simpler. */
return INT32_P (INTVAL (op)); return UINT32_P (INTVAL (op));
case LABEL_REF : case LABEL_REF :
return TARGET_ADDR24; return TARGET_ADDR24;
case CONST_DOUBLE : case CONST_DOUBLE :
...@@ -1345,9 +1349,11 @@ function_arg_partial_nregs (cum, mode, type, named) ...@@ -1345,9 +1349,11 @@ function_arg_partial_nregs (cum, mode, type, named)
int named ATTRIBUTE_UNUSED; int named ATTRIBUTE_UNUSED;
{ {
int ret; int ret;
int size = (((mode == BLKmode && type) unsigned int size =
? int_size_in_bytes (type) (((mode == BLKmode && type)
: GET_MODE_SIZE (mode)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ? (unsigned int) int_size_in_bytes (type)
: GET_MODE_SIZE (mode)) + UNITS_PER_WORD - 1)
/ UNITS_PER_WORD;
if (*cum >= M32R_MAX_PARM_REGS) if (*cum >= M32R_MAX_PARM_REGS)
ret = 0; ret = 0;
...@@ -1559,7 +1565,6 @@ m32r_sched_reorder (stream, verbose, ready, n_ready) ...@@ -1559,7 +1565,6 @@ m32r_sched_reorder (stream, verbose, ready, n_ready)
for (i = n_ready-1; i >= 0; i--) for (i = n_ready-1; i >= 0; i--)
{ {
rtx insn = ready[i]; rtx insn = ready[i];
enum rtx_code code;
if (! m32r_is_insn (insn)) if (! m32r_is_insn (insn))
{ {
...@@ -1615,7 +1620,6 @@ m32r_sched_reorder (stream, verbose, ready, n_ready) ...@@ -1615,7 +1620,6 @@ m32r_sched_reorder (stream, verbose, ready, n_ready)
for (i = 0; i < n_ready; i++) for (i = 0; i < n_ready; i++)
{ {
rtx insn = ready[i]; rtx insn = ready[i];
enum rtx_code code;
fprintf (stream, " %d", INSN_UID (ready[i])); fprintf (stream, " %d", INSN_UID (ready[i]));
...@@ -2608,12 +2612,12 @@ emit_cond_move (operands, insn) ...@@ -2608,12 +2612,12 @@ emit_cond_move (operands, insn)
} }
sprintf (buffer, "mvfc %s, cbr", dest); sprintf (buffer, "mvfc %s, cbr", dest);
/* If the true value was '0' then we need to invert the results of the move. */ /* If the true value was '0' then we need to invert the results of the move. */
if (INTVAL (operands [2]) == 0) if (INTVAL (operands [2]) == 0)
sprintf (buffer + strlen (buffer), "\n\txor3 %s, %s, #1", sprintf (buffer + strlen (buffer), "\n\txor3 %s, %s, #1",
dest, dest); dest, dest);
return buffer; return buffer;
} }
...@@ -2777,7 +2781,7 @@ m32r_expand_block_move (operands) ...@@ -2777,7 +2781,7 @@ m32r_expand_block_move (operands)
operands[3] is a temp register. operands[3] is a temp register.
operands[4] is a temp register. */ operands[4] is a temp register. */
char * void
m32r_output_block_move (insn, operands) m32r_output_block_move (insn, operands)
rtx insn ATTRIBUTE_UNUSED; rtx insn ATTRIBUTE_UNUSED;
rtx operands[]; rtx operands[];
...@@ -2891,8 +2895,6 @@ m32r_output_block_move (insn, operands) ...@@ -2891,8 +2895,6 @@ m32r_output_block_move (insn, operands)
first_time = 0; first_time = 0;
} }
return "";
} }
/* Return true if op is an integer constant, less than or equal to /* Return true if op is an integer constant, less than or equal to
......
...@@ -753,15 +753,13 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; ...@@ -753,15 +753,13 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
#define INT8_P(X) ((X) >= -0x80 && (X) <= 0x7f) #define INT8_P(X) ((X) >= -0x80 && (X) <= 0x7f)
#define INT16_P(X) ((X) >= -0x8000 && (X) <= 0x7fff) #define INT16_P(X) ((X) >= -0x8000 && (X) <= 0x7fff)
#define CMP_INT16_P(X) ((X) >= -0x7fff && (X) <= 0x8000) #define CMP_INT16_P(X) ((X) >= -0x7fff && (X) <= 0x8000)
#define UINT16_P(X) (((unsigned HOST_WIDE_INT)(X)) <= 0xffff)
#define UPPER16_P(X) (((X) & 0xffff) == 0 \ #define UPPER16_P(X) (((X) & 0xffff) == 0 \
&& ((X) >> 16) >= -0x8000 \ && ((X) >> 16) >= -0x8000 \
&& ((X) >> 16) <= 0x7fff) && ((X) >> 16) <= 0x7fff)
#define UINT24_P(X) (((unsigned HOST_WIDE_INT) (X)) < 0x1000000) #define UINT16_P(X) (((unsigned HOST_WIDE_INT) (X)) <= 0x0000ffff)
#define INT32_P(X) (((X) >= -(HOST_WIDE_INT) 0x80000000 \ #define UINT24_P(X) (((unsigned HOST_WIDE_INT) (X)) <= 0x00ffffff)
&& (X) <= (HOST_WIDE_INT) 0x7fffffff) \ #define UINT32_P(X) (((unsigned HOST_WIDE_INT) (X)) <= 0xffffffff)
|| (unsigned HOST_WIDE_INT) (X) <= 0xffffffff) #define UINT5_P(X) ((X) >= 0 && (X) < 32)
#define UINT5_P(X) ((X) >= 0 && (X) < 32)
#define INVERTED_SIGNED_8BIT(VAL) ((VAL) >= -127 && (VAL) <= 128) #define INVERTED_SIGNED_8BIT(VAL) ((VAL) >= -127 && (VAL) <= 128)
#define CONST_OK_FOR_LETTER_P(VALUE, C) \ #define CONST_OK_FOR_LETTER_P(VALUE, C) \
...@@ -1046,19 +1044,11 @@ M32R_STACK_ALIGN (current_function_outgoing_args_size) ...@@ -1046,19 +1044,11 @@ M32R_STACK_ALIGN (current_function_outgoing_args_size)
/* Round arg MODE/TYPE up to the next word boundary. */ /* Round arg MODE/TYPE up to the next word boundary. */
#define ROUND_ADVANCE_ARG(MODE, TYPE) \ #define ROUND_ADVANCE_ARG(MODE, TYPE) \
((MODE) == BLKmode \ ((MODE) == BLKmode \
? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \ ? ROUND_ADVANCE ((unsigned int) int_size_in_bytes (TYPE)) \
: ROUND_ADVANCE (GET_MODE_SIZE (MODE))) : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))
/* Round CUM up to the necessary point for argument MODE/TYPE. */ /* Round CUM up to the necessary point for argument MODE/TYPE. */
#if 0
#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \
((((MODE) == BLKmode ? TYPE_ALIGN (TYPE) : GET_MODE_BITSIZE (MODE)) \
> BITS_PER_WORD) \
? ((CUM) + 1 & ~1) \
: (CUM))
#else
#define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) (CUM) #define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) (CUM)
#endif
/* Return boolean indicating arg of type TYPE and mode MODE will be passed in /* Return boolean indicating arg of type TYPE and mode MODE will be passed in
a reg. This includes arguments that have to be passed by reference as the a reg. This includes arguments that have to be passed by reference as the
......
;; Machine description of the Mitsubishi M32R cpu for GNU C compiler ;; Machine description of the Mitsubishi M32R cpu for GNU C compiler
;; Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. ;; Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
;; This file is part of GNU CC. ;; This file is part of GNU CC.
...@@ -2498,6 +2498,6 @@ ...@@ -2498,6 +2498,6 @@
(clobber (match_scratch:SI 3 "=&r")) ;; temp 1 (clobber (match_scratch:SI 3 "=&r")) ;; temp 1
(clobber (match_scratch:SI 4 "=&r"))] ;; temp 2 (clobber (match_scratch:SI 4 "=&r"))] ;; temp 2
"" ""
"* return m32r_output_block_move (insn, operands);" "* m32r_output_block_move (insn, operands); return \"\"; "
[(set_attr "type" "store8") [(set_attr "type" "store8")
(set_attr "length" "72")]) ;; Maximum (set_attr "length" "72")]) ;; Maximum
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment