PATCH: gcc/config/pa/pa-protos.h and prototype fixes

Brown, Rodney rodneybrown@pmsc.com
Sat Jan 8 19:23:00 GMT 2000


Title: PATCH: gcc/config/pa/pa-protos.h and prototype fixes





The substantive changes have been tested on hppa1.1-hpux11.0 and hppa2.0-hpux10.20
with no testsuite regressions. I didn't rebuild after the following change
to config/pa/pa.c
-static void pa_combine_instructions          PARAMS((rtx i ATTRIBUTE_UNUSED));
+static void pa_combine_instructions          PARAMS((rtx /*UNUSED*/));


The change to the symbolic_operand call in config/pa/pa.md and the
change to the constrain_operands call in config/pa/pa.c should change the
generated code.
If the pa-protos.h file doesn't constitute a minor change, I'm not yet
copyright assigned.


The ChangeLog entry has one for the frame.h change missing from that patch.


gcc/ChangeLog entry
2000-01-09  Rodney Brown <RodneyBrown@pmsc.com>
        * frame.h: convert to PARAMS to allow HP-UX unbundled bootstrap
        * config/pa/pa.md: fix Prototype mismatches
        * config/pa/pa.c: include recog.h, tm_p.h,
        PROTO => PARAMS as per gansidecl.h, fix Prototype mismatches,
        (pa_can_combine_p): declare static
        * config/pa/pa-protos.h: New file.  Prototypes for functions defined
        in pa.c.
        * config/pa/pa.h: Moved prototypes to pa.h.
        fix Prototype mismatches in ADJUST_PRIORITY, PRINT_OPERAND_ADDRESS


--- gcc/config/pa/pa.md.orig    Tue Jan  4 08:43:48 2000
+++ gcc/config/pa/pa.md Wed Jan  5 12:08:00 2000
@@ -1620,7 +1620,7 @@
        (plus:SI (match_operand:SI 1 "register_operand" "r")
                 (high:SI (match_operand 2 "" ""))))]
   "symbolic_operand (operands[2], Pmode)
-   && ! function_label_operand (operands[2])
+   && ! function_label_operand (operands[2], Pmode)
    && flag_pic == 2"
   "addil LT'%G2,%1"
   [(set_attr "type" "binary")
@@ -1652,7 +1652,7 @@
   [(set (match_operand:SI 0 "register_operand" "=a")
        (high:SI (match_operand 1 "" "")))]
   "symbolic_operand (operands[1], Pmode)
-   && ! function_label_operand (operands[1])
+   && ! function_label_operand (operands[1], Pmode)
    && ! read_only_operand (operands[1])
    && ! flag_pic"
   "*
@@ -1688,7 +1688,7 @@
 (define_insn ""
   [(set (match_operand:SI 0 "register_operand" "=r")
        (high:SI (match_operand 1 "" "")))]
-  "(!flag_pic || !symbolic_operand (operands[1]), Pmode)
+  "(!flag_pic || !symbolic_operand (operands[1], Pmode))
     && !is_function_label_plus_const (operands[1])"
   "*
 {
--- gcc/config/pa/pa.c.orig     Thu Dec  2 09:54:54 1999
+++ gcc/config/pa/pa.c  Sun Jan  9 12:50:22 2000
@@ -37,17 +37,21 @@
 #include "function.h"
 #include "expr.h"
 #include "obstack.h"
+#include "recog.h"
 #include "toplev.h"
 #include "ggc.h"
+#include "tm_p.h"
 
-static void restore_unscaled_index_insn_codes          PROTO((rtx));
-static void record_unscaled_index_insn_codes           PROTO((rtx));
-static void pa_combine_instructions                    PROTO((rtx));
-static int pa_can_combine_p    PROTO((rtx, rtx, rtx, int, rtx, rtx, rtx));
-static int forward_branch_p                            PROTO((rtx));
-static int shadd_constant_p                            PROTO((int));
-static void pa_add_gc_roots                             PROTO((void));
-static void mark_deferred_plabels                       PROTO((void *));
+static void restore_unscaled_index_insn_codes          PARAMS((rtx));
+static void record_unscaled_index_insn_codes           PARAMS((rtx));
+static void pa_combine_instructions                    PARAMS((rtx /*UNUSED*/));
+static int pa_can_combine_p    PARAMS((rtx, rtx, rtx, int, rtx, rtx, rtx));
+static int forward_branch_p                            PARAMS((rtx));
+static int shadd_constant_p                            PARAMS((int));
+static void pa_add_gc_roots                             PARAMS((void));
+static void mark_deferred_plabels                       PARAMS((void *));
+extern void output_global_address      PARAMS ((FILE *, rtx, int));
+extern char * output_millicode_call    PARAMS ((rtx, rtx));
 
 /* Save the operands last given to a compare for use when we
    generate a scc or bcc insn.  */
@@ -648,7 +652,7 @@
   rtx pic_ref = orig;
 
   /* Labels need special handling.  */
-  if (pic_label_operand (orig))
+  if (pic_label_operand (orig, mode))
     {
       /* We do not want to go through the movXX expanders here since that
         would create recursion.
@@ -6497,7 +6501,7 @@
     }
 }
 
-int
+static int
 pa_can_combine_p (new, anchor, floater, reversed, dest, src1, src2)
      rtx new, anchor, floater;
      int reversed;
@@ -6518,7 +6522,7 @@
   INSN_CODE (new) = -1;
   insn_code_number = recog_memoized (new);
   if (insn_code_number < 0
-      || !constrain_operands (insn_code_number, 1))
+      || !constrain_operands (1))
     return 0;
 
   if (reversed)
--- gcc/config/pa/pa.h.orig     Wed Dec 22 00:50:55 1999
+++ gcc/config/pa/pa.h  Wed Jan  5 11:54:34 2000
@@ -294,17 +294,6 @@
 /* Machine dependent reorg pass.  */
 #define MACHINE_DEPENDENT_REORG(X) pa_reorg(X)
 
-/* Prototype function used in MACHINE_DEPENDENT_REORG macro. */
-void pa_reorg ();
-
-/* Prototype function used in various macros. */
-int symbolic_operand ();
-
-/* Used in insn-*.c. */
-int following_call ();
-int function_label_operand ();
-int lhs_lshift_cint_operand ();
-
 /* Names to predefine in the preprocessor for this target machine.  */
 
 #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -Asystem(unix) -Asystem(bsd) -Acpu(hppa) -Amachine(hppa)"

@@ -1219,18 +1208,15 @@
    Ordinarily they are not call used registers, but they are for
    _builtin_saveregs, so we must make this explicit.  */
 
-extern struct rtx_def *hppa_builtin_saveregs ();
 #define EXPAND_BUILTIN_SAVEREGS() hppa_builtin_saveregs ()
 
 /* Implement `va_start' for varargs and stdarg.  */
 
-extern void hppa_va_start();
 #define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \
   hppa_va_start (stdarg, valist, nextarg)
 
 /* Implement `va_arg'.  */
 
-extern struct rtx_def *hppa_va_arg();
 #define EXPAND_BUILTIN_VA_ARG(valist, type) \
   hppa_va_arg (valist, type)
 


@@ -1586,7 +1572,6 @@
    It is always safe for this macro to do nothing.  It exists to recognize
    opportunities to optimize the output.  */
 
-extern struct rtx_def *hppa_legitimize_address ();
 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) \
 { rtx orig_x = (X);                            \
   (X) = hppa_legitimize_address (X, OLDX, MODE);       \
@@ -1859,17 +1844,17 @@
        dest = SET_DEST (set);                                  \
        if (GET_CODE (src) == LO_SUM                            \
            && symbolic_operand (XEXP (src, 1), VOIDmode)       \
-           && ! read_only_operand (XEXP (src, 1), VOIDmode))   \
+           && ! read_only_operand (XEXP (src, 1)))             \
          INSN_PRIORITY (PREV) >>= 3;                           \
         else if (GET_CODE (src) == MEM                         \
                 && GET_CODE (XEXP (src, 0)) == LO_SUM          \
                 && symbolic_operand (XEXP (XEXP (src, 0), 1), VOIDmode)\
-                && ! read_only_operand (XEXP (XEXP (src, 0), 1), VOIDmode))\
+                && ! read_only_operand (XEXP (XEXP (src, 0), 1)))\
          INSN_PRIORITY (PREV) >>= 1;                           \
        else if (GET_CODE (dest) == MEM                         \
                 && GET_CODE (XEXP (dest, 0)) == LO_SUM         \
                 && symbolic_operand (XEXP (XEXP (dest, 0), 1), VOIDmode)\
-                && ! read_only_operand (XEXP (XEXP (dest, 0), 1), VOIDmode))\
+                && ! read_only_operand (XEXP (XEXP (dest, 0), 1)))\
          INSN_PRIORITY (PREV) >>= 3;                           \
       }                                                                \
   }
@@ -2153,7 +2138,7 @@
       fprintf (FILE, "%d(%s)", offset, reg_names [REGNO (base)]);      \
       break;                                                           \
     case LO_SUM:                                                       \
-      if (!symbolic_operand (XEXP (addr, 1)))                          \
+      if (!symbolic_operand (XEXP (addr, 1), VOIDmode))                        \
        fputs ("R'", FILE);                                             \
       else if (flag_pic == 0)                                          \
        fputs ("RR'", FILE);                                            \
@@ -2174,90 +2159,6 @@
     }}
 
 


-/* Define functions in pa.c and used in insn-output.c.  */
-
-extern char *output_and ();
-extern char *output_ior ();
-extern char *output_move_double ();
-extern char *output_fp_move_double ();
-extern char *output_block_move ();
-extern char *output_cbranch ();
-extern char *output_bb ();
-extern char *output_bvb ();
-extern char *output_dbra ();
-extern char *output_movb ();
-extern char *output_parallel_movb ();
-extern char *output_parallel_addb ();
-extern char *output_return ();
-extern char *output_call ();
-extern char *output_millicode_call ();
-extern char *output_mul_insn ();
-extern char *output_div_insn ();
-extern char *output_mod_insn ();
-extern char *singlemove_string ();
-extern void output_arg_descriptor ();
-extern void output_deferred_plabels ();
-extern void override_options ();
-extern void output_ascii ();
-extern void output_function_prologue ();
-extern void output_function_epilogue ();
-extern void output_global_address ();
-extern void print_operand ();
-extern struct rtx_def *legitimize_pic_address ();
-extern struct rtx_def *gen_cmp_fp ();
-extern void hppa_encode_label ();
-extern int arith11_operand ();
-extern int symbolic_expression_p ();
-extern int reloc_needed ();
-extern int compute_frame_size ();
-extern int hppa_address_cost ();
-extern int and_mask_p ();
-extern int symbolic_memory_operand ();
-extern int pa_adjust_cost ();
-extern int pa_adjust_insn_length ();
-extern int int11_operand ();
-extern int reg_or_cint_move_operand ();
-extern int arith5_operand ();
-extern int uint5_operand ();
-extern int pic_label_operand ();
-extern int plus_xor_ior_operator ();
-extern int basereg_operand ();
-extern int shadd_operand ();
-extern int arith_operand ();
-extern int read_only_operand ();
-extern int move_operand ();
-extern int and_operand ();
-extern int ior_operand ();
-extern int arith32_operand ();
-extern int uint32_operand ();
-extern int reg_or_nonsymb_mem_operand ();
-extern int reg_or_0_operand ();
-extern int reg_or_0_or_nonsymb_mem_operand ();
-extern int pre_cint_operand ();
-extern int post_cint_operand ();
-extern int div_operand ();
-extern int int5_operand ();
-extern int movb_comparison_operator ();
-extern int ireg_or_int5_operand ();
-extern int fmpyaddoperands ();
-extern int fmpysuboperands ();
-extern int call_operand_address ();
-extern int cint_ok_for_move ();
-extern int ior_operand ();
-extern void emit_bcond_fp ();
-extern int emit_move_sequence ();
-extern int emit_hpdiv_const ();
-extern void hppa_expand_prologue ();
-extern void hppa_expand_epilogue ();
-extern int hppa_can_use_return_insn_p ();
-extern int is_function_label_plus_const ();
-extern int jump_in_call_delay ();
-extern enum reg_class secondary_reload_class ();
-extern int insn_sets_and_refs_are_delayed ();
-
-/* Declare functions defined in pa.c and used in templates.  */
-
-extern struct rtx_def *return_addr_rtx ();
 
 /* Find the return address associated with the frame given by
    FRAMEADDR.  */
--- /dev/null   Sun Jan  9 12:02:36 2000
+++ gcc/config/pa/pa-protos.h   Fri Jan  7 14:22:46 2000
@@ -0,0 +1,134 @@
+/* Prototypes of target machine for GNU compiler.  HPPA version.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+
+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.  */
+
+#ifndef __PA_PROTOS_H__
+#define __PA_PROTOS_H__
+
+extern void override_options           PARAMS ((void));
+extern int cint_ok_for_move            PARAMS ((HOST_WIDE_INT));
+extern int zdepi_cint_p                        PARAMS ((unsigned HOST_WIDE_INT));
+extern int and_mask_p                  PARAMS ((unsigned HOST_WIDE_INT));
+extern int ior_mask_p                  PARAMS ((unsigned HOST_WIDE_INT));
+extern void compute_zdepwi_operands    PARAMS ((unsigned HOST_WIDE_INT, unsigned *));
+extern void output_ascii               PARAMS ((FILE *, unsigned char *, int));
+extern int compute_frame_size          PARAMS ((int, int *));
+extern void output_function_prologue   PARAMS ((FILE *, int /*UNUSED*/));
+extern void hppa_expand_prologue       PARAMS ((void));
+extern void output_function_epilogue   PARAMS ((FILE *, int /*UNUSED*/));
+extern void hppa_expand_epilogue       PARAMS ((void));
+extern int hppa_can_use_return_insn_p  PARAMS ((void));
+extern void output_deferred_plabels    PARAMS ((FILE *));
+
+#ifdef TREE_CODE
+extern int reloc_needed                        PARAMS ((tree));
+extern enum direction function_arg_padding     PARAMS ((enum machine_mode, tree));
+#ifdef RTX_CODE
+extern void hppa_va_start              PARAMS ((int, tree, rtx));
+extern rtx hppa_va_arg                 PARAMS ((tree, tree));
+#endif /* RTX_CODE */
+#endif /* TREE_CODE */
+
+#ifdef RTX_CODE
+extern struct rtx_def * hppa_builtin_saveregs  PARAMS ((void));
+extern int symbolic_expression_p       PARAMS ((register rtx));
+extern rtx legitimize_pic_address      PARAMS ((rtx, enum machine_mode /*UNUSED*/, rtx));
+extern int hppa_address_cost           PARAMS ((rtx));
+extern int emit_move_sequence          PARAMS ((rtx *, enum machine_mode, rtx));
+extern int read_only_operand           PARAMS ((rtx));
+extern char * singlemove_string                PARAMS ((rtx *));
+extern char * output_move_double       PARAMS ((rtx *));
+extern char * output_fp_move_double    PARAMS ((rtx *));
+extern char * output_block_move                PARAMS ((rtx *, int /*UNUSED*/));
+extern int compute_movstrsi_length     PARAMS ((rtx));
+extern char * output_and               PARAMS ((rtx *));
+extern char * output_ior               PARAMS ((rtx *));
+extern void remove_useless_addtr_insns PARAMS ((rtx, int));
+extern rtx return_addr_rtx             PARAMS ((int /*UNUSED*/, rtx));
+extern void emit_bcond_fp              PARAMS ((enum rtx_code, rtx));
+extern rtx gen_cmp_fp                  PARAMS ((enum rtx_code, rtx, rtx));
+extern int pa_adjust_cost              PARAMS ((rtx, rtx, rtx, int));
+extern int pa_adjust_insn_length       PARAMS((rtx, int));
+extern void print_operand              PARAMS ((FILE *, rtx, int));
+extern void output_global_address      PARAMS ((FILE *, rtx, int));
+extern char * output_mul_insn          PARAMS ((int /*UNUSED*/, rtx));
+extern int emit_hpdiv_const            PARAMS ((rtx *, int));
+extern char * output_div_insn          PARAMS ((rtx *, int, rtx));
+extern char * output_mod_insn          PARAMS ((int, rtx));
+extern void output_arg_descriptor      PARAMS ((rtx));
+extern enum reg_class secondary_reload_class   PARAMS ((enum reg_class, enum machine_mode, rtx));
+extern char * output_cbranch   PARAMS ((rtx *, int, int, int, rtx));
+extern char * output_bb                PARAMS ((rtx *o ATTRIBUTE_UNUSED, int, int, int, rtx, int));
+extern char * output_bvb       PARAMS ((rtx *o ATTRIBUTE_UNUSED, int, int, int, rtx, int));
+extern char * output_dbra      PARAMS ((rtx *, rtx, int));
+extern char * output_movb      PARAMS ((rtx *, rtx, int, int));
+extern char * output_millicode_call    PARAMS ((rtx, rtx));
+extern char * output_call              PARAMS ((rtx, rtx));
+extern void hppa_encode_label          PARAMS ((rtx, int));
+extern rtx hppa_legitimize_address     PARAMS ((rtx, rtx /*UNUSED*/, enum machine_mode));
+extern int is_function_label_plus_const        PARAMS ((rtx));
+extern int fmpyaddoperands             PARAMS ((rtx *));
+extern int fmpysuboperands             PARAMS ((rtx *));
+extern int jump_in_call_delay          PARAMS ((rtx));
+extern char * output_parallel_movb     PARAMS ((rtx *, int));
+extern char * output_parallel_addb     PARAMS ((rtx *, int));
+extern int following_call              PARAMS ((rtx));
+extern void pa_reorg                   PARAMS ((rtx));
+extern int insn_refs_are_delayed       PARAMS ((rtx));
+
+/* Recognition functions that return if a condition is true.  */
+extern int reg_or_0_operand            PARAMS ((rtx, enum machine_mode));
+extern int call_operand_address                PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int symbolic_operand            PARAMS ((register rtx, enum machine_mode /*UNUSED*/));
+extern int symbolic_memory_operand     PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int reg_or_nonsymb_mem_operand  PARAMS ((register rtx, enum machine_mode));
+extern int reg_or_0_or_nonsymb_mem_operand     PARAMS ((register rtx, enum machine_mode));
+extern int move_operand                        PARAMS ((rtx, enum machine_mode));
+extern int reg_or_cint_move_operand    PARAMS ((rtx, enum machine_mode));
+extern int pic_label_operand           PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int fp_reg_operand              PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int arith_operand               PARAMS ((rtx, enum machine_mode));
+extern int arith11_operand             PARAMS ((rtx, enum machine_mode));
+extern int pre_cint_operand            PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int post_cint_operand           PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int arith_double_operand                PARAMS ((rtx, enum machine_mode));
+extern int ireg_or_int5_operand                PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int ireg_operand                        PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int int5_operand                        PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int uint5_operand               PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int int11_operand               PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int uint32_operand              PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int arith5_operand              PARAMS ((rtx, enum machine_mode));
+extern int and_operand                 PARAMS ((rtx, enum machine_mode));
+extern int ior_operand                 PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int lhs_lshift_operand          PARAMS ((rtx, enum machine_mode));
+extern int lhs_lshift_cint_operand     PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int arith32_operand             PARAMS ((rtx, enum machine_mode));
+extern int pc_or_label_operand         PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int div_operand                 PARAMS ((rtx, enum machine_mode));
+extern int function_label_operand      PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int plus_xor_ior_operator       PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int shadd_operand               PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int basereg_operand             PARAMS ((rtx, enum machine_mode));
+extern int non_hard_reg_operand                PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int eq_neq_comparison_operator  PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+extern int movb_comparison_operator    PARAMS ((rtx, enum machine_mode /*UNUSED*/));
+#endif /* RTX_CODE */
+
+#endif /* __PA_PROTOS_H__ */






More information about the Gcc-patches mailing list