summaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/ia64-c.c4
-rw-r--r--gcc/config/ia64/ia64-protos.h6
-rw-r--r--gcc/config/ia64/ia64.c85
-rw-r--r--gcc/config/ia64/ia64.h36
-rw-r--r--gcc/config/ia64/sysv4.h9
-rw-r--r--gcc/config/ia64/t-ia642
-rw-r--r--gcc/config/ia64/vms.h16
7 files changed, 92 insertions, 66 deletions
diff --git a/gcc/config/ia64/ia64-c.c b/gcc/config/ia64/ia64-c.c
index c89a83cd99b..7a0bdd7a3cd 100644
--- a/gcc/config/ia64/ia64-c.c
+++ b/gcc/config/ia64/ia64-c.c
@@ -24,8 +24,8 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "cpplib.h"
-#include "c-common.h"
-#include "c-pragma.h"
+#include "c-family/c-common.h"
+#include "c-family/c-pragma.h"
#include "toplev.h"
#include "tm_p.h"
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 3c6a153498e..a5914b1a5ac 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -1,5 +1,5 @@
/* Definitions of target machine for GNU compiler for IA-64.
- Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2007
+ Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -69,7 +69,6 @@ extern rtx ia64_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
tree, int, int);
extern rtx ia64_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
extern rtx ia64_va_arg (tree, tree);
-extern rtx ia64_function_value (const_tree, const_tree);
#endif /* RTX_CODE */
extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
@@ -80,10 +79,9 @@ extern void ia64_vms_output_aligned_decl_common (FILE *, tree, const char *,
unsigned HOST_WIDE_INT,
unsigned int);
extern void ia64_vms_elf_asm_named_section (const char *, unsigned int, tree);
+extern void ia64_start_function (FILE *, const char *, tree);
#endif /* TREE_CODE */
-extern int ia64_register_move_cost (enum machine_mode, enum reg_class,
- enum reg_class);
extern int ia64_epilogue_uses (int);
extern int ia64_eh_uses (int);
extern void emit_safe_across_calls (void);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index e1e3dff8b59..7df747bf986 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -207,6 +207,11 @@ static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static bool ia64_function_ok_for_sibcall (tree, tree);
static bool ia64_return_in_memory (const_tree, const_tree);
+static rtx ia64_function_value (const_tree, const_tree, bool);
+static rtx ia64_libcall_value (enum machine_mode, const_rtx);
+static bool ia64_function_value_regno_p (const unsigned int);
+static int ia64_register_move_cost (enum machine_mode, reg_class_t,
+ reg_class_t);
static bool ia64_rtx_costs (rtx, int, int, int *, bool);
static int ia64_unspec_may_trap_p (const_rtx, unsigned);
static void fix_range (const char *);
@@ -451,6 +456,8 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_ASM_GLOBALIZE_DECL_NAME
#define TARGET_ASM_GLOBALIZE_DECL_NAME ia64_globalize_decl_name
+#undef TARGET_REGISTER_MOVE_COST
+#define TARGET_REGISTER_MOVE_COST ia64_register_move_cost
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS ia64_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -482,6 +489,13 @@ static const struct attribute_spec ia64_attribute_table[] =
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
#endif
+#undef TARGET_FUNCTION_VALUE
+#define TARGET_FUNCTION_VALUE ia64_function_value
+#undef TARGET_LIBCALL_VALUE
+#define TARGET_LIBCALL_VALUE ia64_libcall_value
+#undef TARGET_FUNCTION_VALUE_REGNO_P
+#define TARGET_FUNCTION_VALUE_REGNO_P ia64_function_value_regno_p
+
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX ia64_struct_value_rtx
#undef TARGET_RETURN_IN_MEMORY
@@ -496,8 +510,8 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ia64_gimplify_va_arg
-#undef TARGET_UNWIND_EMIT
-#define TARGET_UNWIND_EMIT process_for_unwind_directive
+#undef TARGET_ASM_UNWIND_EMIT
+#define TARGET_ASM_UNWIND_EMIT process_for_unwind_directive
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P ia64_scalar_mode_supported_p
@@ -3413,6 +3427,29 @@ ia64_expand_prologue (void)
finish_spill_pointers ();
}
+/* Output the textual info surrounding the prologue. */
+
+void
+ia64_start_function (FILE *file, const char *fnname,
+ tree decl ATTRIBUTE_UNUSED)
+{
+#if VMS_DEBUGGING_INFO
+ if (vms_debug_main
+ && strncmp (vms_debug_main, fnname, strlen (vms_debug_main)) == 0)
+ {
+ targetm.asm_out.globalize_label (asm_out_file, VMS_DEBUG_MAIN_POINTER);
+ ASM_OUTPUT_DEF (asm_out_file, VMS_DEBUG_MAIN_POINTER, fnname);
+ dwarf2out_vms_debug_main_pointer ();
+ vms_debug_main = 0;
+ }
+#endif
+
+ fputs ("\t.proc ", file);
+ assemble_name (file, fnname);
+ fputc ('\n', file);
+ ASM_OUTPUT_LABEL (file, fnname);
+}
+
/* Called after register allocation to add any instructions needed for the
epilogue. Using an epilogue insn is favored compared to putting all of the
instructions in output_function_prologue(), since it allows the scheduler
@@ -4637,13 +4674,20 @@ ia64_return_in_memory (const_tree valtype, const_tree fntype ATTRIBUTE_UNUSED)
/* Return rtx for register that holds the function return value. */
-rtx
-ia64_function_value (const_tree valtype, const_tree func)
+static rtx
+ia64_function_value (const_tree valtype,
+ const_tree fn_decl_or_type,
+ bool outgoing ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
enum machine_mode hfa_mode;
int unsignedp;
+ const_tree func = fn_decl_or_type;
+ if (fn_decl_or_type
+ && !DECL_P (fn_decl_or_type))
+ func = NULL;
+
mode = TYPE_MODE (valtype);
hfa_mode = hfa_element_mode (valtype, 0);
@@ -4721,6 +4765,28 @@ ia64_function_value (const_tree valtype, const_tree func)
}
}
+/* Worker function for TARGET_LIBCALL_VALUE. */
+
+static rtx
+ia64_libcall_value (enum machine_mode mode,
+ const_rtx fun ATTRIBUTE_UNUSED)
+{
+ return gen_rtx_REG (mode,
+ (((GET_MODE_CLASS (mode) == MODE_FLOAT
+ || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
+ && (mode) != TFmode)
+ ? FR_RET_FIRST : GR_RET_FIRST));
+}
+
+/* Worker function for FUNCTION_VALUE_REGNO_P. */
+
+static bool
+ia64_function_value_regno_p (const unsigned int regno)
+{
+ return ((regno >= GR_RET_FIRST && regno <= GR_RET_LAST)
+ || (regno >= FR_RET_FIRST && regno <= FR_RET_LAST));
+}
+
/* This is called from dwarf2out.c via TARGET_ASM_OUTPUT_DWARF_DTPREL.
We need to emit DTP-relative relocations. */
@@ -5140,10 +5206,13 @@ ia64_rtx_costs (rtx x, int code, int outer_code, int *total,
/* Calculate the cost of moving data from a register in class FROM to
one in class TO, using MODE. */
-int
-ia64_register_move_cost (enum machine_mode mode, enum reg_class from,
- enum reg_class to)
+static int
+ia64_register_move_cost (enum machine_mode mode, reg_class_t from_i,
+ reg_class_t to_i)
{
+ enum reg_class from = (enum reg_class) from_i;
+ enum reg_class to = (enum reg_class) to_i;
+
/* ADDL_REGS is the same as GR_REGS for movement purposes. */
if (to == ADDL_REGS)
to = GR_REGS;
@@ -5540,7 +5609,7 @@ void ia64_init_expanders (void)
static struct machine_function *
ia64_init_machine_status (void)
{
- return GGC_CNEW (struct machine_function);
+ return ggc_alloc_cleared_machine_function ();
}
static enum attr_itanium_class ia64_safe_itanium_class (rtx);
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index c019aa48184..d3821f6c6f4 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1042,12 +1042,6 @@ enum reg_class
#define ACCUMULATE_OUTGOING_ARGS 1
-/* A C expression that should indicate the number of bytes of its own arguments
- that a function pops on returning, or 0 if the function pops no arguments
- and the caller must therefore pop them all after the function returns. */
-
-#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
-
/* Function Arguments in Registers */
@@ -1146,31 +1140,6 @@ do { \
#define FUNCTION_ARG_REGNO_P(REGNO) \
(((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
|| ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
-
-/* How Scalar Function Values are Returned */
-
-/* A C expression to create an RTX representing the place where a function
- returns a value of data type VALTYPE. */
-
-#define FUNCTION_VALUE(VALTYPE, FUNC) \
- ia64_function_value (VALTYPE, FUNC)
-
-/* A C expression to create an RTX representing the place where a library
- function returns a value of mode MODE. */
-
-#define LIBCALL_VALUE(MODE) \
- gen_rtx_REG (MODE, \
- (((GET_MODE_CLASS (MODE) == MODE_FLOAT \
- || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) && \
- (MODE) != TFmode) \
- ? FR_RET_FIRST : GR_RET_FIRST))
-
-/* A C expression that is nonzero if REGNO is the number of a hard register in
- which the values of called function may come back. */
-
-#define FUNCTION_VALUE_REGNO_P(REGNO) \
- (((REGNO) >= GR_RET_FIRST && (REGNO) <= GR_RET_LAST) \
- || ((REGNO) >= FR_RET_FIRST && (REGNO) <= FR_RET_LAST))
/* How Large Values are Returned */
@@ -1335,11 +1304,6 @@ do { \
/* Describing Relative Costs of Operations */
-/* A C expression for the cost of moving data from a register in class FROM to
- one in class TO, using MODE. */
-
-#define REGISTER_MOVE_COST ia64_register_move_cost
-
/* A C expression for the cost of moving data of mode M between a
register and memory. */
#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index 678a81ec628..0d760731b46 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -1,7 +1,7 @@
/* Override definitions in elfos.h/svr4.h to be correct for IA64.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
-2007 Free Software Foundation, Inc.
+2007, 2010 Free Software Foundation, Inc.
This file is part of GCC.
@@ -127,12 +127,7 @@ do { \
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
-do { \
- fputs ("\t.proc ", FILE); \
- assemble_name (FILE, NAME); \
- fputc ('\n', FILE); \
- ASM_OUTPUT_LABEL (FILE, NAME); \
-} while (0)
+ ia64_start_function(FILE,NAME,DECL)
/* We redefine this to use the ia64 .endp pseudo-op. */
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index db7a8298d17..212bef7cfab 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -46,7 +46,7 @@ LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
$(srcdir)/unwind-c.c
ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h
+ coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) $(C_PRAGMA_H) toplev.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/ia64/ia64-c.c
diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h
index 279586c0398..3d678ce5f85 100644
--- a/gcc/config/ia64/vms.h
+++ b/gcc/config/ia64/vms.h
@@ -1,5 +1,5 @@
/* Definitions of target machine GNU compiler. IA64-VMS version.
- Copyright (C) 2003-2009 Free Software Foundation, Inc.
+ Copyright (C) 2003-2010 Free Software Foundation, Inc.
Contributed by Douglas B Rupp (rupp@gnat.com).
This file is part of GCC.
@@ -72,13 +72,13 @@ along with GCC; see the file COPYING3. If not see
/* Turn on VMS specific Dwarf2 features. */
#define VMS_DEBUGGING_INFO 1
-#define ASM_OUTPUT_DWARF_DELTA_UNITS(FILE,SIZE,LABEL1,LABEL2,UNITS) \
-do { \
- fprintf (FILE, "\tdata4.ua\t ("); \
- assemble_name (FILE, LABEL1); \
- fprintf (FILE, "-"); \
- assemble_name (FILE, LABEL2); \
- fprintf (FILE, ")/16*3"); \
+#define ASM_OUTPUT_DWARF_VMS_DELTA(FILE,SIZE,LABEL1,LABEL2) \
+do { \
+ fprintf (FILE, "\tdata4.ua\t@slotcount("); \
+ assemble_name (FILE, LABEL1); \
+ fprintf (FILE, "-"); \
+ assemble_name (FILE, LABEL2); \
+ fprintf (FILE, ")"); \
} while (0)
#undef STARTFILE_SPEC