Commit f27cd94d by Nick Clifton Committed by Nick Clifton

Fix compile time warnings

From-SVN: r36562
parent 1d5d6f3f
2000-09-21 Nick Clifton <nickc@redhat.com>
* config/mcore/mcore.c: Fix compile time warnings.
* config/mcore/mcore-protos.h: Fix compile time warnings.
2000-09-20 J. David Anglin <dave@hiauly1.hia.nrc.ca> 2000-09-20 J. David Anglin <dave@hiauly1.hia.nrc.ca>
* configure.in: Correct test of gcc_cv_glibc. * configure.in: Correct test of gcc_cv_glibc.
......
/* Prototypes for exported functions defined in mcore.c /* Prototypes for exported functions defined in mcore.c
Copyright (C) 2000 Free Software Foundation, Inc. Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Nick Clifton (nickc@cygnus.com) Contributed by Nick Clifton (nickc@redhat.com)
This file is part of GNU CC. This file is part of GNU CC.
...@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -19,7 +19,7 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
extern char * mcore_output_jump_label_table PARAMS ((void)); extern const char * mcore_output_jump_label_table PARAMS ((void));
extern void mcore_expand_prolog PARAMS ((void)); extern void mcore_expand_prolog PARAMS ((void));
extern void mcore_expand_epilog PARAMS ((void)); extern void mcore_expand_epilog PARAMS ((void));
extern int mcore_const_ok_for_inline PARAMS ((long)); extern int mcore_const_ok_for_inline PARAMS ((long));
...@@ -57,9 +57,9 @@ extern rtx mcore_function_value PARAMS ((tree, tree)); ...@@ -57,9 +57,9 @@ extern rtx mcore_function_value PARAMS ((tree, tree));
extern rtx arch_compare_op0; extern rtx arch_compare_op0;
extern rtx arch_compare_op1; extern rtx arch_compare_op1;
extern char * mcore_output_bclri PARAMS ((rtx, int)); extern const char * mcore_output_bclri PARAMS ((rtx, int));
extern char * mcore_output_bseti PARAMS ((rtx, int)); extern const char * mcore_output_bseti PARAMS ((rtx, int));
extern char * mcore_output_cmov PARAMS ((rtx *, int, char *)); extern const char * mcore_output_cmov PARAMS ((rtx *, int, char *));
extern char * mcore_output_call PARAMS ((rtx *, int)); extern char * mcore_output_call PARAMS ((rtx *, int));
extern int mcore_is_dead PARAMS ((rtx, rtx)); extern int mcore_is_dead PARAMS ((rtx, rtx));
extern int mcore_expand_insv PARAMS ((rtx *)); extern int mcore_expand_insv PARAMS ((rtx *));
...@@ -70,7 +70,7 @@ extern void mcore_dependent_reorg PARAMS ((rtx)); ...@@ -70,7 +70,7 @@ extern void mcore_dependent_reorg PARAMS ((rtx));
extern int mcore_const_costs PARAMS ((rtx, RTX_CODE)); extern int mcore_const_costs PARAMS ((rtx, RTX_CODE));
extern int mcore_and_cost PARAMS ((rtx)); extern int mcore_and_cost PARAMS ((rtx));
extern int mcore_ior_cost PARAMS ((rtx)); extern int mcore_ior_cost PARAMS ((rtx));
extern char * mcore_output_andn PARAMS ((rtx, rtx *)); extern const char * mcore_output_andn PARAMS ((rtx, rtx *));
extern void mcore_print_operand_address PARAMS ((FILE *, rtx)); extern void mcore_print_operand_address PARAMS ((FILE *, rtx));
extern void mcore_print_operand PARAMS ((FILE *, rtx, int)); extern void mcore_print_operand PARAMS ((FILE *, rtx, int));
extern rtx mcore_gen_compare_reg PARAMS ((RTX_CODE)); extern rtx mcore_gen_compare_reg PARAMS ((RTX_CODE));
...@@ -80,9 +80,9 @@ extern int mcore_is_same_reg PARAMS ((rtx, rtx)); ...@@ -80,9 +80,9 @@ extern int mcore_is_same_reg PARAMS ((rtx, rtx));
extern int mcore_arith_S_operand PARAMS ((rtx)); extern int mcore_arith_S_operand PARAMS ((rtx));
#ifdef HAVE_MACHINE_MODES #ifdef HAVE_MACHINE_MODES
extern char * mcore_output_move PARAMS ((rtx, rtx *, enum machine_mode)); extern const char * mcore_output_move PARAMS ((rtx, rtx *, enum machine_mode));
extern char * mcore_output_movedouble PARAMS ((rtx *, enum machine_mode)); extern const char * mcore_output_movedouble PARAMS ((rtx *, enum machine_mode));
extern char * mcore_output_inline_const_forced PARAMS ((rtx, rtx *, enum machine_mode)); extern const char * mcore_output_inline_const_forced PARAMS ((rtx, rtx *, enum machine_mode));
extern int mcore_arith_reg_operand PARAMS ((rtx, enum machine_mode)); extern int mcore_arith_reg_operand PARAMS ((rtx, enum machine_mode));
extern int mcore_general_movsrc_operand PARAMS ((rtx, enum machine_mode)); extern int mcore_general_movsrc_operand PARAMS ((rtx, enum machine_mode));
extern int mcore_general_movdst_operand PARAMS ((rtx, enum machine_mode)); extern int mcore_general_movdst_operand PARAMS ((rtx, enum machine_mode));
......
...@@ -44,9 +44,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -44,9 +44,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "toplev.h" #include "toplev.h"
#include "mcore-protos.h" #include "mcore-protos.h"
static int const_ok_for_mcore PARAMS ((int));
static int try_constant_tricks PARAMS ((long, int *, int *));
/* Maximum size we are allowed to grow the stack in a single operation. /* Maximum size we are allowed to grow the stack in a single operation.
If we want more, we must do it in increments of at most this size. If we want more, we must do it in increments of at most this size.
If this value is 0, we don't check at all. */ If this value is 0, we don't check at all. */
...@@ -88,6 +85,54 @@ enum reg_class reg_class_from_letter[] = ...@@ -88,6 +85,54 @@ enum reg_class reg_class_from_letter[] =
/* y */ NO_REGS, /* z */ NO_REGS /* y */ NO_REGS, /* z */ NO_REGS
}; };
struct mcore_frame
{
int arg_size; /* stdarg spills (bytes) */
int reg_size; /* non-volatile reg saves (bytes) */
int reg_mask; /* non-volatile reg saves */
int local_size; /* locals */
int outbound_size; /* arg overflow on calls out */
int pad_outbound;
int pad_local;
int pad_reg;
/* Describe the steps we'll use to grow it. */
#define MAX_STACK_GROWS 4 /* gives us some spare space */
int growth[MAX_STACK_GROWS];
int arg_offset;
int reg_offset;
int reg_growth;
int local_growth;
};
typedef enum
{
COND_NO,
COND_MOV_INSN,
COND_CLR_INSN,
COND_INC_INSN,
COND_DEC_INSN,
COND_BRANCH_INSN
}
cond_type;
static void output_stack_adjust PARAMS ((int, int));
static int calc_live_regs PARAMS ((int *));
static int const_ok_for_mcore PARAMS ((int));
static int try_constant_tricks PARAMS ((long, int *, int *));
static const char * output_inline_const PARAMS ((enum machine_mode, rtx *));
static void block_move_sequence PARAMS ((rtx, rtx, rtx, rtx, int, int, int));
static void layout_mcore_frame PARAMS ((struct mcore_frame *));
static cond_type is_cond_candidate PARAMS ((rtx));
static rtx emit_new_cond_insn PARAMS ((rtx, int));
static rtx conditionalize_block PARAMS ((rtx));
static void conditionalize_optimization PARAMS ((rtx));
static void mcore_add_gc_roots PARAMS ((void));
static rtx handle_structs_in_regs PARAMS ((enum machine_mode, tree, int));
static void mcore_mark_dllexport PARAMS ((tree));
static void mcore_mark_dllimport PARAMS ((tree));
static int mcore_dllexport_p PARAMS ((tree));
static int mcore_dllimport_p PARAMS ((tree));
/* Adjust the stack and return the number of bytes taken to do it. */ /* Adjust the stack and return the number of bytes taken to do it. */
static void static void
output_stack_adjust (direction, size) output_stack_adjust (direction, size)
...@@ -507,6 +552,7 @@ mcore_call_address_operand (x, mode) ...@@ -507,6 +552,7 @@ mcore_call_address_operand (x, mode)
} }
/* Functions to output assembly code for a function call. */ /* Functions to output assembly code for a function call. */
char * char *
mcore_output_call (operands, index) mcore_output_call (operands, index)
rtx operands[]; rtx operands[];
...@@ -831,7 +877,7 @@ mcore_halfword_offset (mask) ...@@ -831,7 +877,7 @@ mcore_halfword_offset (mask)
} }
/* Output a series of bseti's corresponding to mask. */ /* Output a series of bseti's corresponding to mask. */
char * const char *
mcore_output_bseti (dst, mask) mcore_output_bseti (dst, mask)
rtx dst; rtx dst;
int mask; int mask;
...@@ -856,7 +902,7 @@ mcore_output_bseti (dst, mask) ...@@ -856,7 +902,7 @@ mcore_output_bseti (dst, mask)
} }
/* Output a series of bclri's corresponding to mask. */ /* Output a series of bclri's corresponding to mask. */
char * const char *
mcore_output_bclri (dst, mask) mcore_output_bclri (dst, mask)
rtx dst; rtx dst;
int mask; int mask;
...@@ -884,7 +930,7 @@ mcore_output_bclri (dst, mask) ...@@ -884,7 +930,7 @@ mcore_output_bclri (dst, mask)
/* Output a conditional move of two constants that are +/- 1 within each /* Output a conditional move of two constants that are +/- 1 within each
other. See the "movtK" patterns in mcore.md. I'm not sure this is other. See the "movtK" patterns in mcore.md. I'm not sure this is
really worth the effort. */ really worth the effort. */
char * const char *
mcore_output_cmov (operands, cmp_t, test) mcore_output_cmov (operands, cmp_t, test)
rtx operands[]; rtx operands[];
int cmp_t; int cmp_t;
...@@ -953,14 +999,14 @@ mcore_output_cmov (operands, cmp_t, test) ...@@ -953,14 +999,14 @@ mcore_output_cmov (operands, cmp_t, test)
/* Outputs the peephole for moving a constant that gets not'ed followed /* Outputs the peephole for moving a constant that gets not'ed followed
by an and (i.e. combine the not and the and into andn) BRC */ by an and (i.e. combine the not and the and into andn) BRC */
char * const char *
mcore_output_andn (insn, operands) mcore_output_andn (insn, operands)
rtx insn ATTRIBUTE_UNUSED; rtx insn ATTRIBUTE_UNUSED;
rtx operands[]; rtx operands[];
{ {
int x, y; int x, y;
rtx out_operands[3]; rtx out_operands[3];
char * load_op; const char * load_op;
char buf[256]; char buf[256];
if (try_constant_tricks (INTVAL (operands[1]), &x, &y) != 2) if (try_constant_tricks (INTVAL (operands[1]), &x, &y) != 2)
...@@ -988,7 +1034,7 @@ mcore_output_andn (insn, operands) ...@@ -988,7 +1034,7 @@ mcore_output_andn (insn, operands)
} }
/* Output an inline constant. */ /* Output an inline constant. */
static char * static const char *
output_inline_const (mode, operands) output_inline_const (mode, operands)
enum machine_mode mode; enum machine_mode mode;
rtx operands[]; rtx operands[];
...@@ -998,7 +1044,7 @@ output_inline_const (mode, operands) ...@@ -998,7 +1044,7 @@ output_inline_const (mode, operands)
rtx out_operands[3]; rtx out_operands[3];
char buf[256]; char buf[256];
char load_op[256]; char load_op[256];
char *dst_fmt; const char *dst_fmt;
int value; int value;
value = INTVAL (operands[1]); value = INTVAL (operands[1]);
...@@ -1086,7 +1132,7 @@ output_inline_const (mode, operands) ...@@ -1086,7 +1132,7 @@ output_inline_const (mode, operands)
} }
/* Output a move of a word or less value. */ /* Output a move of a word or less value. */
char * const char *
mcore_output_move (insn, operands, mode) mcore_output_move (insn, operands, mode)
rtx insn ATTRIBUTE_UNUSED; rtx insn ATTRIBUTE_UNUSED;
rtx operands[]; rtx operands[];
...@@ -1139,7 +1185,7 @@ mcore_output_move (insn, operands, mode) ...@@ -1139,7 +1185,7 @@ mcore_output_move (insn, operands, mode)
Useful for things where we've gotten into trouble and think we'd Useful for things where we've gotten into trouble and think we'd
be doing an lrw into r15 (forbidden). This lets us get out of be doing an lrw into r15 (forbidden). This lets us get out of
that pickle even after register allocation. */ that pickle even after register allocation. */
char * const char *
mcore_output_inline_const_forced (insn, operands, mode) mcore_output_inline_const_forced (insn, operands, mode)
rtx insn ATTRIBUTE_UNUSED; rtx insn ATTRIBUTE_UNUSED;
rtx operands[]; rtx operands[];
...@@ -1226,7 +1272,7 @@ mcore_output_inline_const_forced (insn, operands, mode) ...@@ -1226,7 +1272,7 @@ mcore_output_inline_const_forced (insn, operands, mode)
/* Return a sequence of instructions to perform DI or DF move. /* Return a sequence of instructions to perform DI or DF move.
Since the MCORE cannot move a DI or DF in one instruction, we have Since the MCORE cannot move a DI or DF in one instruction, we have
to take care when we see overlapping source and dest registers. */ to take care when we see overlapping source and dest registers. */
char * const char *
mcore_output_movedouble (operands, mode) mcore_output_movedouble (operands, mode)
rtx operands[]; rtx operands[];
enum machine_mode mode ATTRIBUTE_UNUSED; enum machine_mode mode ATTRIBUTE_UNUSED;
...@@ -1658,7 +1704,7 @@ mcore_expand_insv (operands) ...@@ -1658,7 +1704,7 @@ mcore_expand_insv (operands)
We don't have to mask if we're shifting this up against the We don't have to mask if we're shifting this up against the
MSB of the register (e.g., the shift will push out any hi-order MSB of the register (e.g., the shift will push out any hi-order
bits. */ bits. */
if (width + posn != GET_MODE_SIZE (SImode)) if (width + posn != (int) GET_MODE_SIZE (SImode))
{ {
ereg = force_reg (SImode, GEN_INT ((1 << width) - 1)); ereg = force_reg (SImode, GEN_INT ((1 << width) - 1));
emit_insn (gen_rtx (SET, SImode, sreg, emit_insn (gen_rtx (SET, SImode, sreg,
...@@ -1705,7 +1751,7 @@ mcore_load_multiple_operation (op, mode) ...@@ -1705,7 +1751,7 @@ mcore_load_multiple_operation (op, mode)
if (GET_CODE (elt) != SET if (GET_CODE (elt) != SET
|| GET_CODE (SET_DEST (elt)) != REG || GET_CODE (SET_DEST (elt)) != REG
|| GET_MODE (SET_DEST (elt)) != SImode || GET_MODE (SET_DEST (elt)) != SImode
|| REGNO (SET_DEST (elt)) != dest_regno + i || REGNO (SET_DEST (elt)) != (unsigned) (dest_regno + i)
|| GET_CODE (SET_SRC (elt)) != MEM || GET_CODE (SET_SRC (elt)) != MEM
|| GET_MODE (SET_SRC (elt)) != SImode || GET_MODE (SET_SRC (elt)) != SImode
|| GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS
...@@ -1746,7 +1792,7 @@ mcore_store_multiple_operation (op, mode) ...@@ -1746,7 +1792,7 @@ mcore_store_multiple_operation (op, mode)
if (GET_CODE (elt) != SET if (GET_CODE (elt) != SET
|| GET_CODE (SET_SRC (elt)) != REG || GET_CODE (SET_SRC (elt)) != REG
|| GET_MODE (SET_SRC (elt)) != SImode || GET_MODE (SET_SRC (elt)) != SImode
|| REGNO (SET_SRC (elt)) != src_regno + i || REGNO (SET_SRC (elt)) != (unsigned) (src_regno + i)
|| GET_CODE (SET_DEST (elt)) != MEM || GET_CODE (SET_DEST (elt)) != MEM
|| GET_MODE (SET_DEST (elt)) != SImode || GET_MODE (SET_DEST (elt)) != SImode
|| GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS
...@@ -1916,31 +1962,10 @@ static int number_of_regs_before_varargs; ...@@ -1916,31 +1962,10 @@ static int number_of_regs_before_varargs;
for a varargs function. */ for a varargs function. */
static int current_function_anonymous_args; static int current_function_anonymous_args;
#define STACK_BYTES (STACK_BOUNDARY/BITS_PER_UNIT) #define STACK_BYTES (STACK_BOUNDARY/BITS_PER_UNIT)
#define STORE_REACH (64) /* Maximum displace of word store + 4. */ #define STORE_REACH (64) /* Maximum displace of word store + 4. */
#define ADDI_REACH (32) /* Maximum addi operand. */ #define ADDI_REACH (32) /* Maximum addi operand. */
struct mcore_frame
{
int arg_size; /* stdarg spills (bytes) */
int reg_size; /* non-volatile reg saves (bytes) */
int reg_mask; /* non-volatile reg saves */
int local_size; /* locals */
int outbound_size; /* arg overflow on calls out */
int pad_outbound;
int pad_local;
int pad_reg;
/* describe the steps we'll use to grow it */
#define MAX_STACK_GROWS 4 /* gives us some spare space */
int growth[MAX_STACK_GROWS];
int arg_offset;
int reg_offset;
int reg_growth;
int local_growth;
};
static void static void
layout_mcore_frame (infp) layout_mcore_frame (infp)
struct mcore_frame * infp; struct mcore_frame * infp;
...@@ -2369,6 +2394,7 @@ mcore_expand_epilog () ...@@ -2369,6 +2394,7 @@ mcore_expand_epilog ()
int offs; int offs;
int growth = MAX_STACK_GROWS - 1 ; int growth = MAX_STACK_GROWS - 1 ;
/* Find out what we're doing. */ /* Find out what we're doing. */
layout_mcore_frame(&fi); layout_mcore_frame(&fi);
...@@ -2508,7 +2534,7 @@ static int pool_size; ...@@ -2508,7 +2534,7 @@ static int pool_size;
/* Dump out any constants accumulated in the final pass. These /* Dump out any constants accumulated in the final pass. These
will only be labels. */ will only be labels. */
char * const char *
mcore_output_jump_label_table () mcore_output_jump_label_table ()
{ {
int i; int i;
...@@ -2597,17 +2623,6 @@ mcore_dependent_simplify_rtx (x, int_op0_mode, last, in_dest, general_simplify) ...@@ -2597,17 +2623,6 @@ mcore_dependent_simplify_rtx (x, int_op0_mode, last, in_dest, general_simplify)
} }
#endif #endif
typedef enum
{
COND_NO,
COND_MOV_INSN,
COND_CLR_INSN,
COND_INC_INSN,
COND_DEC_INSN,
COND_BRANCH_INSN
}
cond_type;
/* Check whether insn is a candidate for a conditional. */ /* Check whether insn is a candidate for a conditional. */
static cond_type static cond_type
is_cond_candidate (insn) is_cond_candidate (insn)
...@@ -3540,7 +3555,7 @@ mcore_unique_section (decl, reloc) ...@@ -3540,7 +3555,7 @@ mcore_unique_section (decl, reloc)
int len; int len;
char * name; char * name;
char * string; char * string;
char * prefix; const char * prefix;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
......
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