aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-01-26 00:09:47 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-01-26 00:09:47 +0000
commit3f12cd9b3cfa9d4011eda8a9b469107a59ffe6e0 (patch)
tree12ffb8fbb5d5960c65feb60cbb87a19c6f75430f
parentf289e226f1468a16627cef00b4678259c7a8d653 (diff)
downloadgcc-3f12cd9b3cfa9d4011eda8a9b469107a59ffe6e0.zip
gcc-3f12cd9b3cfa9d4011eda8a9b469107a59ffe6e0.tar.gz
gcc-3f12cd9b3cfa9d4011eda8a9b469107a59ffe6e0.tar.bz2
pa-protos.h: Remove the prototype for hppa_builtin_saveregs.
* config/pa/pa-protos.h: Remove the prototype for hppa_builtin_saveregs. Add a prototype for pa_return_in_memory. * config/pa/pa.c (TARGET_PROMOTE_FUNCTION_RETURN): New. (TARGET_PROMOTE_PROTOTYPES): Likewise. (TARGET_STRUCT_VALUE_RTX): Likewise. (TARGET_RETURN_IN_MEMORY): Likewise. (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise. (pa_struct_value_rtx): Likewise. (pa_return_in_memory): Likewise. * config/pa/pa.h (STRUCT_VALUE_REGNUM): Rename to PA_STRUCT_VALUE_REGNUM. (INIT_CUMULATIVE_ARGS): Use pa_return_in_memory. (EXPAND_BUILTIN_SAVEREGS): Remove. (PROMOTE_PROTOTYPES): Likewise. (PROMOTE_FUNCTION_RETURN): Likewise. From-SVN: r76600
-rw-r--r--gcc/ChangeLog19
-rw-r--r--gcc/config/pa/pa-protos.h3
-rw-r--r--gcc/config/pa/pa.c42
-rw-r--r--gcc/config/pa/pa.h27
4 files changed, 62 insertions, 29 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7217aec..5d2e816 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,24 @@
2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
+ * config/pa/pa-protos.h: Remove the prototype for
+ hppa_builtin_saveregs. Add a prototype for
+ pa_return_in_memory.
+ * config/pa/pa.c (TARGET_PROMOTE_FUNCTION_RETURN): New.
+ (TARGET_PROMOTE_PROTOTYPES): Likewise.
+ (TARGET_STRUCT_VALUE_RTX): Likewise.
+ (TARGET_RETURN_IN_MEMORY): Likewise.
+ (TARGET_EXPAND_BUILTIN_SAVEREGS): Likewise.
+ (pa_struct_value_rtx): Likewise.
+ (pa_return_in_memory): Likewise.
+ * config/pa/pa.h (STRUCT_VALUE_REGNUM): Rename to
+ PA_STRUCT_VALUE_REGNUM.
+ (INIT_CUMULATIVE_ARGS): Use pa_return_in_memory.
+ (EXPAND_BUILTIN_SAVEREGS): Remove.
+ (PROMOTE_PROTOTYPES): Likewise.
+ (PROMOTE_FUNCTION_RETURN): Likewise.
+
+2004-01-25 Kazu Hirata <kazu@cs.umass.edu>
+
* config/vax/vax.c (TARGET_PROMOTE_PROTOTYPES): New.
(TARGET_STRUCT_VALUE_RTX): Likewise.
(vax_struct_value_rtx): Likewise.
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index 848997e..5bc5a6b 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -133,8 +133,6 @@ extern int insn_refs_are_delayed (rtx);
/* Prototype function used in macro CONST_OK_FOR_LETTER_P. */
extern int zdepi_cint_p (unsigned HOST_WIDE_INT);
-extern struct rtx_def *hppa_builtin_saveregs (void);
-
extern void override_options (void);
extern void output_ascii (FILE *, const char *, int);
extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int *);
@@ -164,4 +162,5 @@ extern rtx function_value (tree, tree);
extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
enum machine_mode,
tree, int);
+extern bool pa_return_in_memory (tree, tree);
#endif /* TREE_CODE */
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 3d3b1ae..9328531 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -131,6 +131,7 @@ static void pa_asm_out_constructor (rtx, int);
static void pa_asm_out_destructor (rtx, int);
#endif
static void pa_init_builtins (void);
+static rtx hppa_builtin_saveregs (void);
static void copy_fp_args (rtx) ATTRIBUTE_UNUSED;
static int length_fp_args (rtx) ATTRIBUTE_UNUSED;
static struct deferred_plabel *get_plabel (const char *)
@@ -148,6 +149,7 @@ static void output_deferred_plabels (void);
#ifdef HPUX_LONG_DOUBLE_LIBRARY
static void pa_hpux_init_libfuncs (void);
#endif
+static rtx pa_struct_value_rtx (tree, int);
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -261,6 +263,19 @@ static size_t n_deferred_plabels = 0;
#define TARGET_INIT_LIBFUNCS pa_hpux_init_libfuncs
#endif
+#undef TARGET_PROMOTE_FUNCTION_RETURN
+#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true
+#undef TARGET_PROMOTE_PROTOTYPES
+#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX pa_struct_value_rtx
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY pa_return_in_memory
+
+#undef TARGET_EXPAND_BUILTIN_SAVEREGS
+#define TARGET_EXPAND_BUILTIN_SAVEREGS hppa_builtin_saveregs
+
struct gcc_target targetm = TARGET_INITIALIZER;
void
@@ -5836,7 +5851,7 @@ function_arg_padding (enum machine_mode mode, tree type)
to determine if stdargs or varargs is used and fill in an initial
va_list. A pointer to this constructor is returned. */
-struct rtx_def *
+static rtx
hppa_builtin_saveregs (void)
{
rtx offset, dest;
@@ -8748,7 +8763,7 @@ insn_refs_are_delayed (rtx insn)
the mode is SF or DF. Then the value is returned in fr4 (32).
This must perform the same promotions as PROMOTE_MODE, else
- PROMOTE_FUNCTION_RETURN will not work correctly.
+ TARGET_PROMOTE_FUNCTION_RETURN will not work correctly.
Small structures must be returned in a PARALLEL on PA64 in order
to match the HP Compiler ABI. */
@@ -9077,4 +9092,27 @@ pa_globalize_label (FILE *stream, const char *name)
fputs (",DATA\n", stream);
}
}
+
+static rtx
+pa_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+ int incoming ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (Pmode, PA_STRUCT_VALUE_REGNUM);
+}
+
+bool
+pa_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+ /* SOM ABI says that objects larger than 64 bits are returned in memory.
+ PA64 ABI says that objects larger than 128 bits are returned in memory.
+ Note, int_size_in_bytes can return -1 if the size of the object is
+ variable or larger than the maximum value that can be expressed as
+ a HOST_WIDE_INT. It can also return zero for an empty type. The
+ simplest way to handle variable and empty types is to pass them in
+ memory. This avoids problems in defining the boundaries of argument
+ slots, allocating registers, etc. */
+ return (int_size_in_bytes (type) > (TARGET_64BIT ? 16 : 8)
+ || int_size_in_bytes (type) <= 0);
+}
+
#include "gt-pa.h"
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index f2ae999..95fb2f2 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -554,21 +554,9 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
#define DEFAULT_PCC_STRUCT_RETURN 0
-/* SOM ABI says that objects larger than 64 bits are returned in memory.
- PA64 ABI says that objects larger than 128 bits are returned in memory.
- Note, int_size_in_bytes can return -1 if the size of the object is
- variable or larger than the maximum value that can be expressed as
- a HOST_WIDE_INT. It can also return zero for an empty type. The
- simplest way to handle variable and empty types is to pass them in
- memory. This avoids problems in defining the boundaries of argument
- slots, allocating registers, etc. */
-#define RETURN_IN_MEMORY(TYPE) \
- (int_size_in_bytes (TYPE) > (TARGET_64BIT ? 16 : 8) \
- || int_size_in_bytes (TYPE) <= 0)
-
/* Register in which address to store a structure value
is passed to a function. */
-#define STRUCT_VALUE_REGNUM 28
+#define PA_STRUCT_VALUE_REGNUM 28
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) \
@@ -804,7 +792,7 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; };
(CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \
? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \
+ (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \
- || RETURN_IN_MEMORY (TREE_TYPE (FNTYPE)))) \
+ || pa_return_in_memory (TREE_TYPE (FNTYPE), 0))) \
: 0)
@@ -1153,13 +1141,6 @@ extern int may_call_alloca;
#define TRAMPOLINE_ADJUST_ADDRESS(ADDR) \
if (!TARGET_64BIT) (ADDR) = memory_address (Pmode, plus_constant ((ADDR), 46))
-/* Emit code for a call to builtin_saveregs. We must emit USE insns which
- reference the 4 integer arg registers and 4 fp arg registers.
- Ordinarily they are not call used registers, but they are for
- _builtin_saveregs, so we must make this explicit. */
-
-#define EXPAND_BUILTIN_SAVEREGS() hppa_builtin_saveregs ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
@@ -1734,10 +1715,6 @@ do { \
is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
-/* When a prototype says `char' or `short', really pass an `int'. */
-#define PROMOTE_PROTOTYPES 1
-#define PROMOTE_FUNCTION_RETURN 1
-
/* Specify the machine mode that pointers have.
After generation of rtl, the compiler makes no further distinction
between pointers and any other objects of this machine mode. */