+2009-08-09 Douglas B Rupp <rupp@gnat.com>
+
+ * config/alpha/alpha.c: Include libfuncs.h
+ (avms_asm_output_extern): New function.
+ (alpha_init_libfuncs): Init some decc libfuncs.
+ * config/alpha/alpha-protos.h (avms_asm_output_external): Declare.
+ * config/alpha/vms.h (ASM_OUTPUT_EXTERNAL): Define.
+ (DO_CRTL_NAMES): Define.
+ (LIB_SPEC): Remove.
+ * config/alpha/vms64.h: (POINTERS_EXTEND_UNSIGNED): Remove undef.
+ (LONG_TYPE_SIZE): Define.
+ (TARGET_OS_CPP_BUILTINS): Define with __LONG_POINTERS=1
+ (SUBTARGET_SWITCHES): Define malloc64 switch.
+ (TARGET_DEFAULT): Default MASK_MALLOC64 set.
+ (MASK_RETURN_ADDR): Define.
+ doc/invoke.texi (mmalloc64): Document switch.
+
2009-08-09 Olivier Hainque <hainque@adacore.com>
Douglas B Rupp <rupp@gnat.com>
/* Prototypes for alpha.c functions used in the md file & elsewhere.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009
Free Software Foundation, Inc.
This file is part of GCC.
#if TARGET_ABI_OPEN_VMS
extern enum avms_arg_type alpha_arg_type (enum machine_mode);
extern rtx alpha_arg_info_reg_val (CUMULATIVE_ARGS);
+extern void avms_asm_output_external (FILE *, tree, const char *);
#endif
extern rtx unicosmk_add_call_info_word (rtx);
#include "tree-stdarg.h"
#include "tm-constrs.h"
#include "df.h"
+#include "libfuncs.h"
/* Specify which cpu to schedule for. */
enum processor_type alpha_tune;
}
}
+#if TARGET_ABI_OPEN_VMS
+void avms_asm_output_external (FILE *file, tree decl ATTRIBUTE_UNUSED, const char *name)
+{
+#ifdef DO_CRTL_NAMES
+ DO_CRTL_NAMES;
+#endif
+}
+#endif
+
#if TARGET_ABI_OSF
/* Emit a tail call to FUNCTION after adjusting THIS by DELTA.
set_optab_libfunc (smod_optab, DImode, "OTS$REM_L");
set_optab_libfunc (umod_optab, SImode, "OTS$REM_UI");
set_optab_libfunc (umod_optab, DImode, "OTS$REM_UL");
+ abort_libfunc = init_one_libfunc ("decc$abort");
+ memcmp_libfunc = init_one_libfunc ("decc$memcmp");
+#ifdef MEM_LIBFUNCS_INIT
+ MEM_LIBFUNCS_INIT;
+#endif
}
}
#define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
+/* The maximum alignment 'malloc' honors. */
+#undef MALLOC_ALIGNMENT
+#define MALLOC_ALIGNMENT ((TARGET_MALLOC64 ? 16 : 8) * BITS_PER_UNIT)
+
#undef FIXED_REGISTERS
#define FIXED_REGISTERS \
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
#define MD_UNWIND_SUPPORT "config/alpha/vms-unwind.h"
#endif
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+ avms_asm_output_external (FILE, DECL, NAME)
+
+typedef struct crtl_name_spec
+{
+ const char *const name;
+ const char *deccname;
+ int referenced;
+} crtl_name_spec;
+
+#include "config/vms/vms-crtl.h"
+
+/* Alias CRTL names to 32/64bit DECCRTL functions.
+ Fixme: This should do a binary search. */
+#define DO_CRTL_NAMES \
+ do \
+ { \
+ int i; \
+ static crtl_name_spec vms_crtl_names[] = CRTL_NAMES; \
+ static int malloc64_init = 0; \
+ \
+ if ((malloc64_init == 0) && TARGET_MALLOC64) \
+ { \
+ for (i=0; vms_crtl_names [i].name; i++) \
+ { \
+ if (strcmp ("calloc", vms_crtl_names [i].name) == 0) \
+ vms_crtl_names [i].deccname = "decc$_calloc64"; \
+ else \
+ if (strcmp ("malloc", vms_crtl_names [i].name) == 0) \
+ vms_crtl_names [i].deccname = "decc$_malloc64"; \
+ else \
+ if (strcmp ("realloc", vms_crtl_names [i].name) == 0) \
+ vms_crtl_names [i].deccname = "decc$_realloc64"; \
+ else \
+ if (strcmp ("strdup", vms_crtl_names [i].name) == 0) \
+ vms_crtl_names [i].deccname = "decc$_strdup64"; \
+ } \
+ malloc64_init = 1; \
+ } \
+ for (i=0; vms_crtl_names [i].name; i++) \
+ if (!vms_crtl_names [i].referenced && \
+ (strcmp (name, vms_crtl_names [i].name) == 0)) \
+ { \
+ fprintf (file, "\t%s=%s\n", \
+ name, vms_crtl_names [i].deccname); \
+ vms_crtl_names [i].referenced = 1; \
+ } \
+ } while (0)
+
/* This is how to output an assembler line
that says to advance the location counter
to a multiple of 2**LOG bytes. */
#define ENDFILE_SPEC \
"%{!shared:crtend.o%s} %{!static:%{shared:crtendS.o%s}}"
-#undef LIB_SPEC
-#define LIB_SPEC "-lc"
-
#define NAME__MAIN "__gccmain"
#define SYMBOL__MAIN __gccmain
/* Output variables, constants and external declarations, for GNU compiler.
- Copyright (C) 2001, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2007, 2009 Free Software Foundation, Inc.
Contributed by Douglas Rupp (rupp@gnat.com).
This file is part of GCC.
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* Defaults to BITS_PER_WORD, e.g. 64 which is what is wanted.
- This is incompatible with DEC C, but matches DEC Ada */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define_std ("vms"); \
+ builtin_define_std ("VMS"); \
+ builtin_define ("__ALPHA"); \
+ builtin_assert ("system=vms"); \
+ builtin_define ("__IEEE_FLOAT"); \
+ builtin_define ("__LONG_POINTERS=1"); \
+ } while (0)
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "malloc64", MASK_MALLOC64, "Malloc data into P2 space" },
+
+#undef TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS | MASK_MALLOC64)
+
#undef LONG_TYPE_SIZE
+#define LONG_TYPE_SIZE 64
+
+#undef POINTER_SIZE
+#define POINTER_SIZE 64
+
+/* Eventhough pointers are 64bits, only 32bit ever remain significant in code
+ addresses. */
+#define MASK_RETURN_ADDR (GEN_INT (0xffffffff))
/* Defaults to "long int" */
#undef SIZE_TYPE
#undef PTRDIFF_TYPE
-#undef POINTERS_EXTEND_UNSIGNED
-#undef POINTER_SIZE
-#define POINTER_SIZE 64
+# include "config/vms/vms-crtl-64.h"
-mmemory-latency=@var{time}}
@emph{DEC Alpha/VMS Options}
-@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix}}
+@gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
@emph{FR30 Options}
@gccoptlist{-msmall-model -mno-lsim}
@opindex mdebug-main=@var{prefix}
Flag the first routine whose name starts with @var{prefix} as the main
routine for the debugger.
+
+@item -mmalloc64
+@opindex mmalloc64
+Default to 64bit memory allocation routines.
@end table
@node FR30 Options