/* Output variables, constants and external declarations, for GNU compiler.
- Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002
+ Free Software Foundation, Inc.
-This file is part of GNU CC.
+This file is part of GCC.
-GNU CC is free software; you can redistribute it and/or modify
+GCC 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,
+GCC 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
+along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define NO_EXTERNAL_INDIRECT_ADDRESS
-#include "alpha/alpha.h"
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES \
-"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem=vms"
-
-#undef CPP_SUBTARGET_SPEC
-#define CPP_SUBTARGET_SPEC "\
-%{mfloat-ieee:-D__IEEE_FLOAT} \
-%{mfloat-vax:-D__G_FLOAT} \
-%{!mfloat-vax:-D__IEEE_FLOAT}"
-
-/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
-
-#define LIB_SPEC "%{p:-lprof1 -lpdf} %{pg:-lprof1 -lpdf} %{a:-lprof2} -lc"
-
-/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
- optimizing, -O1 if we are not. Pass -shared, -non_shared or
- -call_shared as appropriate. Also pass -pg. */
-#define LINK_SPEC \
- "-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
- %{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
- %{rpath*}"
-
-/* We allow $'s in identifiers unless -ansi is used .. */
-
-#define DOLLARS_IN_IDENTIFIERS 2
-
-/* These match the definitions used in DECCRTL, the VMS C run-time library
-
-#define SIZE_TYPE "unsigned int"
-#define PTRDIFF_TYPE "int"
-*/
-
-/* By default, allow $ to be part of an identifier. */
-#define DOLLARS_IN_IDENTIFIERS 2
+#define TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define_std ("vms"); \
+ builtin_define_std ("VMS"); \
+ builtin_define ("__ALPHA"); \
+ builtin_assert ("system=vms"); \
+ if (TARGET_FLOAT_VAX) \
+ builtin_define ("__G_FLOAT"); \
+ else \
+ builtin_define ("__IEEE_FLOAT"); \
+ } while (0)
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_FP|MASK_FPREGS|MASK_GAS)
#define STRUCT_VALUE 0
#undef PCC_STATIC_STRUCT_RETURN
-/* "long" is 32 bits. */
+/* "long" is 32 bits, but 64 bits for Ada. */
#undef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE 32
+#define ADA_LONG_TYPE_SIZE 64
/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
#undef POINTER_SIZE
+ get_frame_size () \
+ current_function_pretend_args_size) \
- current_function_pretend_args_size); \
+ else \
+ abort(); \
if ((TO) == STACK_POINTER_REGNUM) \
(OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \
}
} \
}
-#undef ASM_FILE_START
-#define ASM_FILE_START(FILE) \
-{ \
- alpha_write_verstamp (FILE); \
- fprintf (FILE, "\t.set noreorder\n"); \
- fprintf (FILE, "\t.set volatile\n"); \
- ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
-}
-
-#undef ASM_OUTPUT_FLOAT
-#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
- { \
- if (REAL_VALUE_ISINF (VALUE) \
- || REAL_VALUE_ISNAN (VALUE) \
- || REAL_VALUE_MINUS_ZERO (VALUE)) \
- { \
- long t; \
- REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
- fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
- } \
- else \
- { \
- char str[30]; \
- REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
- fprintf (FILE, "\t.%c_floating %s\n", (TARGET_FLOAT_VAX)?'f':'s', str); \
- } \
- }
+/* ABI has stack checking, but it's broken. */
+#undef STACK_CHECK_BUILTIN
+#define STACK_CHECK_BUILTIN 0
#define LINK_SECTION_ASM_OP "\t.link"
-#define READONLY_SECTION_ASM_OP "\t.rdata"
+#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
#define LITERALS_SECTION_ASM_OP "\t.literals"
#define CTORS_SECTION_ASM_OP "\t.ctors"
#define DTORS_SECTION_ASM_OP "\t.dtors"
#undef EXTRA_SECTIONS
-#define EXTRA_SECTIONS in_link, in_rdata, in_literals
+#define EXTRA_SECTIONS in_link, in_literals
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
-readonly_section () \
-{ \
- if (in_section != in_rdata) \
- { \
- fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
- in_section = in_rdata; \
- } \
-} \
-void \
link_section () \
{ \
if (in_section != in_link) \
} \
}
-extern void readonly_section PARAMS ((void));
-extern void link_section PARAMS ((void));
-extern void literals_section PARAMS ((void));
+extern void link_section (void);
+extern void literals_section (void);
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort ()
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\t.quad $L%d\n", (VALUE))
-#undef READONLY_DATA_SECTION
-#define READONLY_DATA_SECTION readonly_section
-
-#define ASM_FILE_END(FILE) alpha_write_linkage (FILE);
-
#undef CASE_VECTOR_MODE
#define CASE_VECTOR_MODE DImode
#undef CASE_VECTOR_PC_RELATIVE
#undef ASM_OUTPUT_CASE_LABEL
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
-{ ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
+{ ASM_OUTPUT_ALIGN (FILE, 3); (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); }
/* This says how to output assembler code to declare an
uninitialized external linkage data object. */
do { \
fprintf ((FILE), "%s", COMMON_ASM_OP); \
assemble_name ((FILE), (NAME)); \
- fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
+ fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
} while (0)
\f
The trampoline should set the static chain pointer to value placed
into the trampoline and should branch to the specified routine.
Note that $27 has been set to the address of the trampoline, so we can
- use it for addressability of the two data items. Trampolines are always
- aligned to FUNCTION_BOUNDARY, which is 64 bits. */
+ use it for addressability of the two data items. */
#undef TRAMPOLINE_TEMPLATE
#define TRAMPOLINE_TEMPLATE(FILE) \
#undef TRAMPOLINE_SIZE
#define TRAMPOLINE_SIZE 32
+/* The alignment of a trampoline, in bits. */
+
+#undef TRAMPOLINE_ALIGNMENT
+#define TRAMPOLINE_ALIGNMENT 64
+
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function. */
#undef MIPS_DEBUGGING_INFO
#undef DBX_DEBUGGING_INFO
-#define DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO 1
+#define VMS_DEBUGGING_INFO 1
+
+#define DWARF2_UNWIND_INFO 1
+
+#undef EH_RETURN_HANDLER_RTX
+#define EH_RETURN_HANDLER_RTX \
+ gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, 8))
+
+#define LINK_EH_SPEC "vms-dwarf2eh.o%s "
+
+#ifdef IN_LIBGCC2
+#include <pdscdef.h>
+
+#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
+ do { \
+ PDSCDEF *pv = *((PDSCDEF **) (CONTEXT)->reg [29]); \
+ \
+ if (pv && ((long) pv & 0x7) == 0) /* low bits 0 means address */ \
+ pv = *(PDSCDEF **) pv; \
+ \
+ if (pv && ((pv->pdsc$w_flags & 0xf) == PDSC$K_KIND_FP_STACK)) \
+ { \
+ int i, j; \
+ \
+ (FS)->cfa_offset = pv->pdsc$l_size; \
+ (FS)->cfa_reg = pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP ? 29 : 30; \
+ (FS)->retaddr_column = 26; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->regs.reg[27].loc.offset = -pv->pdsc$l_size; \
+ (FS)->regs.reg[27].how = REG_SAVED_OFFSET; \
+ (FS)->regs.reg[26].loc.offset \
+ = -(pv->pdsc$l_size - pv->pdsc$w_rsa_offset); \
+ (FS)->regs.reg[26].how = REG_SAVED_OFFSET; \
+ \
+ for (i = 0, j = 0; i < 32; i++) \
+ if (1<<i & pv->pdsc$l_ireg_mask) \
+ { \
+ (FS)->regs.reg[i].loc.offset \
+ = -(pv->pdsc$l_size - pv->pdsc$w_rsa_offset - 8 * ++j); \
+ (FS)->regs.reg[i].how = REG_SAVED_OFFSET; \
+ } \
+ \
+ goto SUCCESS; \
+ } \
+ else if (pv && ((pv->pdsc$w_flags & 0xf) == PDSC$K_KIND_FP_REGISTER)) \
+ { \
+ (FS)->cfa_offset = pv->pdsc$l_size; \
+ (FS)->cfa_reg = pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP ? 29 : 30; \
+ (FS)->retaddr_column = 26; \
+ (FS)->cfa_how = CFA_REG_OFFSET; \
+ (FS)->regs.reg[26].loc.reg = pv->pdsc$b_save_ra; \
+ (FS)->regs.reg[26].how = REG_SAVED_REG; \
+ (FS)->regs.reg[29].loc.reg = pv->pdsc$b_save_fp; \
+ (FS)->regs.reg[29].how = REG_SAVED_REG; \
+ \
+ goto SUCCESS; \
+ } \
+} while (0)
+#endif
/* This is how to output an assembler line
that says to advance the location counter
} while (0)
#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+#define PREFERRED_DEBUGGING_TYPE VMS_AND_DWARF2_DEBUG
-#undef ASM_FORMAT_PRIVATE_NAME
-#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
-( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
- sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
+#define ASM_PN_FORMAT "%s___%lu"
/* ??? VMS uses different linkage. */
-#undef ASM_OUTPUT_MI_THUNK
+#undef TARGET_ASM_OUTPUT_MI_THUNK
#undef ASM_SPEC
#undef ASM_FINAL_SPEC
+
+/* The VMS convention is to always provide minimal debug info
+ for a traceback unless specifically overridden. Defaulting this here
+ is a kludge. */
+
+#define OPTIMIZATION_OPTIONS(OPTIMIZE, OPTIMIZE_SIZE) \
+{ \
+ write_symbols = VMS_DEBUG; \
+ debug_info_level = (enum debug_info_level) 1; \
+}
+
+/* Override traceback debug info on -g0. */
+#undef OVERRIDE_OPTIONS
+#define OVERRIDE_OPTIONS \
+{ \
+ if (write_symbols == NO_DEBUG) \
+ debug_info_level = (enum debug_info_level) 0; \
+ override_options (); \
+}
+
+/* Link with vms-dwarf2.o if -g (except -g0). This causes the
+ VMS link to pull all the dwarf2 debug sections together. */
#undef LINK_SPEC
+#define LINK_SPEC "%{g:-g vms-dwarf2.o%s} %{g0} %{g1:-g1 vms-dwarf2.o%s} \
+%{g2:-g2 vms-dwarf2.o%s} %{g3:-g3 vms-dwarf2.o%s} %{shared} %{v} %{map}"
+
#undef STARTFILE_SPEC
-#define ASM_SPEC "-nocpp %{pg}"
-#define LINK_SPEC "%{g3:-g3} %{g0:-g0} %{shared:-shared} %{v:-v}"
+#define STARTFILE_SPEC "%{!shared:%{mvms-return-codes:vcrt0.o%s} \
+%{!mvms-return-codes:pcrt0.o%s}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "-lc"
/* Define the names of the division and modulus functions. */
#define DIVSI3_LIBCALL "OTS$DIV_I"
#define UMODSI3_LIBCALL "OTS$REM_UI"
#define UMODDI3_LIBCALL "OTS$REM_UL"
-/* crt0 calls __main */
-#define HAS_INIT_SECTION
+#define NAME__MAIN "__gccmain"
+#define SYMBOL__MAIN __gccmain
+
+#define MD_EXEC_PREFIX "/gnu/lib/gcc-lib/"
+#define MD_STARTFILE_PREFIX "/gnu/lib/gcc-lib/"
+
+/* Specify the list of include file directories. */
+#define INCLUDE_DEFAULTS \
+{ \
+ { "/gnu/lib/gcc-lib/include", 0, 0, 0 }, \
+ { "/gnu_gxx_include", 0, 1, 1 }, \
+ { "/gnu_cc_include", 0, 0, 0 }, \
+ { "/gnu/include", 0, 0, 0 }, \
+ { 0, 0, 0, 0 } \
+}
-/* XXX Really? Even with modern CRTL? */
-#define NEED_ATEXIT
+#define LONGLONG_STANDALONE 1