From eba0e962af8d991c7f4a2752b372ad67e449bf8c Mon Sep 17 00:00:00 2001 From: Kaveh Ghazi Date: Mon, 31 Jan 2000 15:59:31 +0000 Subject: * rs6000-protos.h: New file. * rs6000.c: Include tm_p.h. Fix compile time warnings. * rs6000.h: Move prototypes to rs6000-protos.h. Fix compile time warnings. * sysv4.h: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/newppc-branch@31714 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/rs6000/ChangeLog | 11 +++ gcc/config/rs6000/rs6000-protos.h | 148 ++++++++++++++++++++++++++++++++++++++ gcc/config/rs6000/rs6000.c | 57 ++++++++------- gcc/config/rs6000/rs6000.h | 109 +--------------------------- gcc/config/rs6000/sysv4.h | 6 +- 5 files changed, 196 insertions(+), 135 deletions(-) create mode 100644 gcc/config/rs6000/rs6000-protos.h diff --git a/gcc/config/rs6000/ChangeLog b/gcc/config/rs6000/ChangeLog index 4e99681a38b..c37b21b2049 100644 --- a/gcc/config/rs6000/ChangeLog +++ b/gcc/config/rs6000/ChangeLog @@ -1,3 +1,14 @@ +2000-01-31 Kaveh R. Ghazi + + * rs6000-protos.h: New file. + + * rs6000.c: Include tm_p.h. Fix compile time warnings. + + * rs6000.h: Move prototypes to rs6000-protos.h. Fix compile time + warnings. + + * sysv4.h: Likewise. + 2000-01-28 Geoff Keating * ../../configure.in: Delete powerpcle-*-winnt* diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h new file mode 100644 index 00000000000..8d234b85404 --- /dev/null +++ b/gcc/config/rs6000/rs6000-protos.h @@ -0,0 +1,148 @@ +/* Definitions of target machine for GNU compiler, for IBM RS/6000. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Declare functions in rs6000.c */ + +#ifdef RTX_CODE + +#ifdef TREE_CODE +extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int)); +extern void rs6000_va_start PARAMS ((int, tree, rtx)); +#endif /* TREE_CODE */ + +extern struct rtx_def *rs6000_got_register PARAMS ((rtx)); +extern struct rtx_def *find_addr_reg PARAMS ((rtx)); +extern int any_operand PARAMS ((rtx, enum machine_mode)); +extern int short_cint_operand PARAMS ((rtx, enum machine_mode)); +extern int u_short_cint_operand PARAMS ((rtx, enum machine_mode)); +extern int non_short_cint_operand PARAMS ((rtx, enum machine_mode)); +extern int gpc_reg_operand PARAMS ((rtx, enum machine_mode)); +extern int cc_reg_operand PARAMS ((rtx, enum machine_mode)); +extern int cc_reg_not_cr0_operand PARAMS ((rtx, enum machine_mode)); +extern int reg_or_short_operand PARAMS ((rtx, enum machine_mode)); +extern int reg_or_neg_short_operand PARAMS ((rtx, enum machine_mode)); +extern int reg_or_u_short_operand PARAMS ((rtx, enum machine_mode)); +extern int reg_or_cint_operand PARAMS ((rtx, enum machine_mode)); +extern int got_operand PARAMS ((rtx, enum machine_mode)); +extern int got_no_const_operand PARAMS ((rtx, enum machine_mode)); +extern int num_insns_constant PARAMS ((rtx, enum machine_mode)); +extern int easy_fp_constant PARAMS ((rtx, enum machine_mode)); +extern int volatile_mem_operand PARAMS ((rtx, enum machine_mode)); +extern int offsettable_mem_operand PARAMS ((rtx, enum machine_mode)); +extern int mem_or_easy_const_operand PARAMS ((rtx, enum machine_mode)); +extern int add_operand PARAMS ((rtx, enum machine_mode)); +extern int non_add_cint_operand PARAMS ((rtx, enum machine_mode)); +extern int non_logical_cint_operand PARAMS ((rtx, enum machine_mode)); +extern int logical_operand PARAMS ((rtx, enum machine_mode)); +extern int mask_operand PARAMS ((rtx, enum machine_mode)); +extern int mask64_operand PARAMS ((rtx, enum machine_mode)); +extern int and64_operand PARAMS ((rtx, enum machine_mode)); +extern int and_operand PARAMS ((rtx, enum machine_mode)); +extern int count_register_operand PARAMS ((rtx, enum machine_mode)); +extern int fpmem_operand PARAMS ((rtx, enum machine_mode)); +extern int reg_or_mem_operand PARAMS ((rtx, enum machine_mode)); +extern int lwa_operand PARAMS ((rtx, enum machine_mode)); +extern int call_operand PARAMS ((rtx, enum machine_mode)); +extern int current_file_function_operand PARAMS ((rtx, enum machine_mode)); +extern int input_operand PARAMS ((rtx, enum machine_mode)); +extern int small_data_operand PARAMS ((rtx, enum machine_mode)); +extern int expand_block_move PARAMS ((rtx[])); +extern int load_multiple_operation PARAMS ((rtx, enum machine_mode)); +extern int store_multiple_operation PARAMS ((rtx, enum machine_mode)); +extern int branch_comparison_operator PARAMS ((rtx, enum machine_mode)); +extern int scc_comparison_operator PARAMS ((rtx, enum machine_mode)); +extern int trap_comparison_operator PARAMS ((rtx, enum machine_mode)); +extern int includes_lshift_p PARAMS ((rtx, rtx)); +extern int includes_rshift_p PARAMS ((rtx, rtx)); +extern int registers_ok_for_quad_peep PARAMS ((rtx, rtx)); +extern int addrs_ok_for_quad_peep PARAMS ((rtx, rtx)); +extern enum reg_class secondary_reload_class PARAMS ((enum reg_class, + enum machine_mode, rtx)); +extern int ccr_bit PARAMS ((rtx, int)); +extern void rs6000_reorg PARAMS ((rtx)); +extern void print_operand PARAMS ((FILE *, rtx, int)); +extern void print_operand_address PARAMS ((FILE *, rtx)); +extern void output_toc PARAMS ((FILE *, rtx, int)); +extern int rs6000_adjust_cost PARAMS ((rtx, rtx, rtx, int)); +extern int rs6000_adjust_priority PARAMS ((rtx, int)); +extern void rs6000_initialize_trampoline PARAMS ((rtx, rtx, rtx)); +extern struct rtx_def *rs6000_dll_import_ref PARAMS ((rtx)); +extern struct rtx_def *rs6000_longcall_ref PARAMS ((rtx)); +extern void rs6000_fatal_bad_address PARAMS ((rtx)); +extern int stmw_operation PARAMS ((rtx, enum machine_mode)); +extern int mtcrf_operation PARAMS ((rtx, enum machine_mode)); +extern int lmw_operation PARAMS ((rtx, enum machine_mode)); + +#endif /* RTX_CODE */ + +#ifdef TREE_CODE +extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, + tree, int)); +extern int function_arg_boundary PARAMS ((enum machine_mode, tree)); +extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *, + enum machine_mode, tree, int)); +extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, + enum machine_mode, tree, int)); +extern int function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *, + enum machine_mode, + tree, int)); +extern void setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, + enum machine_mode, tree, + int *, int)); +extern struct rtx_def *rs6000_va_arg PARAMS ((tree, tree)); +extern void output_mi_thunk PARAMS ((FILE *, tree, int, tree)); +extern int rs6000_comp_type_attributes PARAMS ((tree, tree)); +extern int rs6000_valid_decl_attribute_p PARAMS ((tree, tree, tree, tree)); +extern int rs6000_valid_type_attribute_p PARAMS ((tree, tree, tree, tree)); +extern void rs6000_set_default_type_attributes PARAMS ((tree)); +#ifdef ARGS_SIZE_RTX +/* expr.h defines ARGS_SIZE_RTX and `enum direction' */ +extern enum direction function_arg_padding PARAMS ((enum machine_mode, tree)); +#endif /* ARGS_SIZE_RTX */ +#endif /* TREE_CODE */ + +extern void optimization_options PARAMS ((int, int)); +extern void rs6000_override_options PARAMS ((const char *)); +extern void rs6000_file_start PARAMS ((FILE *, const char *)); +extern struct rtx_def *rs6000_float_const PARAMS ((const char *, + enum machine_mode)); +extern int direct_return PARAMS ((void)); +extern int get_issue_rate PARAMS ((void)); +extern union tree_node *rs6000_build_va_list PARAMS ((void)); +extern void rs6000_save_machine_status PARAMS ((struct function *)); +extern void rs6000_restore_machine_status PARAMS ((struct function *)); +extern void rs6000_init_expanders PARAMS ((void)); +extern int first_reg_to_save PARAMS ((void)); +extern int first_fp_reg_to_save PARAMS ((void)); +extern rs6000_stack_t *rs6000_stack_info PARAMS ((void)); +extern void output_prolog PARAMS ((FILE *, int)); +extern void output_epilog PARAMS ((FILE *, int)); +extern void output_ascii PARAMS ((FILE *, const char *, int)); +extern void rs6000_gen_section_name PARAMS ((char **, const char *, + const char *)); +extern void output_function_profiler PARAMS ((FILE *, int)); +extern int rs6000_trampoline_size PARAMS ((void)); +extern void toc_section PARAMS ((void)); +extern void private_data_section PARAMS ((void)); +extern void rs6000_emit_prologue PARAMS ((void)); +extern void rs6000_emit_load_toc_table PARAMS ((int)); +extern void rs6000_emit_epilogue PARAMS ((int)); +extern void debug_stack_info PARAMS ((rs6000_stack_t *)); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index bd58c5e8c46..92379257283 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */ #include "toplev.h" #include "ggc.h" #include "hashtab.h" +#include "tm_p.h" #ifndef TARGET_NO_PROTOTYPE #define TARGET_NO_PROTOTYPE 0 @@ -112,8 +113,15 @@ int rs6000_debug_arg; /* debug argument handling */ /* Flag to say the TOC is initialized */ int toc_initialized; -static void rs6000_add_gc_roots PROTO ((void)); - +static void rs6000_add_gc_roots PARAMS ((void)); +static int num_insns_constant_wide PARAMS ((HOST_WIDE_INT)); +static rtx expand_block_move_mem PARAMS ((enum machine_mode, rtx, rtx)); +static void rs6000_emit_allocate_stack PARAMS ((HOST_WIDE_INT, int)); +static unsigned rs6000_hash_constant PARAMS ((rtx)); +static unsigned toc_hash_function PARAMS ((hash_table_entry_t)); +static int toc_hash_eq PARAMS ((hash_table_entry_t, hash_table_entry_t)); +static int toc_hash_mark_entry PARAMS ((hash_table_entry_t, void *)); +static void toc_hash_mark_table PARAMS ((void *)); /* Default register names. */ char rs6000_reg_names[][8] = @@ -1255,7 +1263,6 @@ init_cumulative_args (cum, fntype, libname, incoming) int incoming; { static CUMULATIVE_ARGS zero_cumulative; - enum rs6000_abi abi = DEFAULT_ABI; *cum = zero_cumulative; cum->words = 0; @@ -1308,22 +1315,22 @@ init_cumulative_args (cum, fntype, libname, incoming) For the AIX ABI structs are always stored left shifted in their argument slot. */ -int +enum direction function_arg_padding (mode, type) enum machine_mode mode; tree type; { if (type != 0 && AGGREGATE_TYPE_P (type)) - return (int)upward; + return upward; /* This is the default definition. */ return (! BYTES_BIG_ENDIAN - ? (int)upward + ? upward : ((mode == BLKmode ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT)) : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY) - ? (int)downward : (int)upward)); + ? downward : upward)); } /* If defined, a C expression that gives the alignment boundary, in bits, @@ -1335,7 +1342,7 @@ function_arg_padding (mode, type) int function_arg_boundary (mode, type) enum machine_mode mode; - tree type; + tree type ATTRIBUTE_UNUSED; { if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && (mode == DImode || mode == DFmode)) @@ -3062,7 +3069,7 @@ void print_operand (file, x, code) FILE *file; rtx x; - char code; + int code; { int i; HOST_WIDE_INT val; @@ -4952,7 +4959,7 @@ output_epilog (file, size) different traceback table. */ if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive) { - char *fname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + const char *fname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); int fixed_parms, float_parms, parm_info; int i; @@ -5177,7 +5184,7 @@ output_mi_thunk (file, thunk_fndecl, delta, function) { const char *this_reg = reg_names[ aggregate_value_p (TREE_TYPE (TREE_TYPE (function))) ? 4 : 3 ]; const char *prefix; - char *fname; + const char *fname; const char *r0 = reg_names[0]; #if TARGET_ELF const char *sp = reg_names[1]; @@ -5250,7 +5257,7 @@ output_mi_thunk (file, thunk_fndecl, delta, function) fname = XSTR (XEXP (DECL_RTL (function), 0), 0); - if (current_file_function_operand (XEXP (DECL_RTL (function), 0)) + if (current_file_function_operand (XEXP (DECL_RTL (function), 0), VOIDmode) && ! lookup_attribute ("longcall", TYPE_ATTRIBUTES (TREE_TYPE (function)))) { @@ -5380,7 +5387,7 @@ rs6000_hash_constant (k) case 's': { unsigned i, len; - char *str = XSTR (k, fidx); + const char *str = XSTR (k, fidx); len = strlen (str); result = result * 613 + len; for (i = 0; i < len; i++) @@ -5416,7 +5423,7 @@ static unsigned toc_hash_function (hash_entry) hash_table_entry_t hash_entry; { - return rs6000_hash_constant (((struct toc_hash_struct *) hash_entry)->key); + return rs6000_hash_constant (((const struct toc_hash_struct *) hash_entry)->key); } /* Compare H1 and H2 for equivalence. */ @@ -5425,8 +5432,8 @@ static int toc_hash_eq (h1, h2) hash_table_entry_t h1, h2; { - rtx r1 = ((struct toc_hash_struct *) h1)->key; - rtx r2 = ((struct toc_hash_struct *) h2)->key; + rtx r1 = ((const struct toc_hash_struct *) h1)->key; + rtx r2 = ((const struct toc_hash_struct *) h2)->key; /* Gotcha: One of these const_doubles will be in memory. The other may be on the constant-pool chain. @@ -5459,7 +5466,7 @@ toc_hash_mark_entry (hash_entry, unused) hash_table_entry_t hash_entry; void * unused ATTRIBUTE_UNUSED; { - rtx r = ((struct toc_hash_struct *) hash_entry)->key; + rtx r = ((const struct toc_hash_struct *) hash_entry)->key; ggc_set_mark ((void *)hash_entry); /* For CODE_LABELS, we don't want to drag in the whole insn chain... */ if (GET_CODE (r) == LABEL_REF) @@ -5475,9 +5482,11 @@ toc_hash_mark_entry (hash_entry, unused) /* Mark all the elements of the TOC hash-table *HT. */ static void -toc_hash_mark_table (ht) - hash_table_t *ht; +toc_hash_mark_table (vht) + void *vht; { + hash_table_t *ht = vht; + traverse_hash_table (*ht, toc_hash_mark_entry, 0); } @@ -5491,7 +5500,7 @@ output_toc (file, x, labelno) int labelno; { char buf[256]; - char *name = buf; + const char *name = buf; const char *real_name; rtx base = x; int offset = 0; @@ -5523,7 +5532,7 @@ output_toc (file, x, labelno) ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LC"); fprintf (file, "%d,", labelno); ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LC"); - fprintf (file, "%d\n", ((*(struct toc_hash_struct **) + fprintf (file, "%d\n", ((*(const struct toc_hash_struct **) found)->labelno)); return; } @@ -5785,10 +5794,10 @@ output_ascii (file, p, n) void rs6000_gen_section_name (buf, filename, section_desc) char **buf; - char *filename; - char *section_desc; + const char *filename; + const char *section_desc; { - char *q, *after_last_slash, *last_period = 0; + const char *q, *after_last_slash, *last_period = 0; char *p; int len; diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index a7ee608b5a2..ef0e3fd57b0 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1490,8 +1490,7 @@ typedef struct rs6000_args the argument, `downward' to pad below, or `none' to inhibit padding. */ -#define FUNCTION_ARG_PADDING(MODE, TYPE) \ - (enum direction) function_arg_padding (MODE, TYPE) +#define FUNCTION_ARG_PADDING(MODE, TYPE) function_arg_padding (MODE, TYPE) /* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, @@ -2834,112 +2833,6 @@ extern int optimize; extern int flag_expensive_optimizations; extern int frame_pointer_needed; -/* Declare functions in rs6000.c */ -extern void optimization_options (); -extern void output_options (); -extern void rs6000_override_options (); -extern void rs6000_file_start (); -extern struct rtx_def *rs6000_float_const (); -extern struct rtx_def *rs6000_got_register (); -extern struct rtx_def *find_addr_reg(); -extern int direct_return (); -extern int get_issue_rate (); -extern int any_operand (); -extern int short_cint_operand (); -extern int u_short_cint_operand (); -extern int non_short_cint_operand (); -extern int gpc_reg_operand (); -extern int cc_reg_operand (); -extern int cc_reg_not_cr0_operand (); -extern int reg_or_short_operand (); -extern int reg_or_neg_short_operand (); -extern int reg_or_u_short_operand (); -extern int reg_or_cint_operand (); -extern int got_operand (); -extern int got_no_const_operand (); -extern int num_insns_constant (); -extern int easy_fp_constant (); -extern int volatile_mem_operand (); -extern int offsettable_mem_operand (); -extern int mem_or_easy_const_operand (); -extern int add_operand (); -extern int non_add_cint_operand (); -extern int non_logical_cint_operand (); -extern int logical_operand (); -extern int mask_operand (); -extern int mask64_operand (); -extern int and64_operand (); -extern int and_operand (); -extern int count_register_operand (); -extern int fpmem_operand (); -extern int reg_or_mem_operand (); -extern int lwa_operand (); -extern int call_operand (); -extern int current_file_function_operand (); -extern int input_operand (); -extern int small_data_operand (); -extern void init_cumulative_args (); -extern void function_arg_advance (); -extern int function_arg_boundary (); -extern struct rtx_def *function_arg (); -extern int function_arg_partial_nregs (); -extern int function_arg_pass_by_reference (); -extern void setup_incoming_varargs (); -extern union tree_node *rs6000_build_va_list (); -extern void rs6000_va_start (); -extern struct rtx_def *rs6000_va_arg (); -extern struct rtx_def *rs6000_stack_temp (); -extern int expand_block_move (); -extern int load_multiple_operation (); -extern int store_multiple_operation (); -extern int branch_comparison_operator (); -extern int scc_comparison_operator (); -extern int trap_comparison_operator (); -extern int includes_lshift_p (); -extern int includes_rshift_p (); -extern int registers_ok_for_quad_peep (); -extern int addrs_ok_for_quad_peep (); -extern enum reg_class secondary_reload_class (); -extern int ccr_bit (); -extern void rs6000_finalize_pic (); -extern void rs6000_reorg (); -extern void rs6000_save_machine_status (); -extern void rs6000_restore_machine_status (); -extern void rs6000_init_expanders (); -extern void print_operand (); -extern void print_operand_address (); -extern int first_reg_to_save (); -extern int first_fp_reg_to_save (); -extern int rs6000_makes_calls (); -extern rs6000_stack_t *rs6000_stack_info (); -extern void output_prolog (); -extern void output_epilog (); -extern void output_mi_thunk (); -extern void output_toc (); -extern void output_ascii (); -extern void rs6000_gen_section_name (); -extern void output_function_profiler (); -extern int rs6000_adjust_cost (); -extern int rs6000_adjust_priority (); -extern int rs6000_trampoline_size (); -extern void rs6000_initialize_trampoline (); -extern int rs6000_comp_type_attributes (); -extern int rs6000_valid_decl_attribute_p (); -extern int rs6000_valid_type_attribute_p (); -extern void rs6000_set_default_type_attributes (); -extern struct rtx_def *rs6000_dll_import_ref (); -extern struct rtx_def *rs6000_longcall_ref (); -extern int function_arg_padding (); -extern void toc_section (); -extern void private_data_section (); -extern void rs6000_fatal_bad_address (); -extern void rs6000_emit_prologue (); -extern int stmw_operation (); -extern void rs6000_emit_load_toc_table (); -extern void rs6000_emit_epilogue (); -extern int mtcrf_operation (); -extern int lmw_operation (); - /* See nonlocal_goto_receiver for when this must be set. */ #define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_TOC && TARGET_MINIMAL_TOC) diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 4c5db97e96b..32c80a17cb3 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -773,7 +773,7 @@ do { \ && XSTR (VALUE, 0)[0] == '.' \ && DEFAULT_ABI == ABI_AIX) \ { \ - char *name = XSTR (VALUE, 0); \ + const char *name = XSTR (VALUE, 0); \ while (*name == '.') \ name++; \ \ @@ -859,7 +859,7 @@ do { \ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \ } *sections; \ struct section_info *s; \ - char *mode; \ + const char *mode; \ enum sect_enum type; \ \ for (s = sections; s; s = s->next) \ @@ -1275,7 +1275,7 @@ do { \ %{!msolaris-cclib: scrtn.o%s} \ %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}" -#ifdef CROSS_COMPILER +#ifdef CROSS_COMPILE #define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074" #else #define LINK_START_SOLARIS_SPEC "" -- cgit v1.2.3