|
|
1.1 root 1: /* Output variables, constants and external declarations, for GNU compiler.
2: Copyright (C) 1988 Free Software Foundation, Inc.
3:
4: This file is part of GNU CC.
5:
6: GNU CC is free software; you can redistribute it and/or modify
7: it under the terms of the GNU General Public License as published by
8: the Free Software Foundation; either version 1, or (at your option)
9: any later version.
10:
11: GNU CC is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with GNU CC; see the file COPYING. If not, write to
18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19:
1.1.1.2 root 20: #define NO_EXTERNAL_INDIRECT_ADDRESS /* Alter some macro definitions. */
1.1 root 21: #include "tm-vax.h"
22:
23: #undef CPP_PREDEFINES
24: #undef TARGET_VERSION
25: #undef TARGET_DEFAULT
26: #undef CALL_USED_REGISTERS
27: #undef MAYBE_VMS_FUNCTION_PROLOGUE
1.1.1.3 ! root 28: #undef STARTING_FRAME_OFFSET
1.1 root 29:
30: /* Predefine this in CPP because VMS limits the size of command options
31: and GNU CPP is not used on VMS except with GNU C. */
32: #define CPP_PREDEFINES "-Dvax -Dvms -DVMS -D__GNU__ -D__GNUC__"
33:
34: /* By default, allow $ to be part of an identifier. */
35: #define DOLLARS_IN_IDENTIFIERS 1
36:
37: #define TARGET_DEFAULT 1
38: #define TARGET_VERSION fprintf (stderr, " (vax vms)");
39:
40: #define CALL_USED_REGISTERS {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
41:
1.1.1.3 ! root 42: /* The run-time library routine VAXC$ESTABLISH (necessary when mixing
! 43: VMS exception handling and setjmp/longjmp in the same program) requires
! 44: that a hidden automatic variable at the top of the stack be reserved
! 45: for its use. We accomplish this by simply adding 4 bytes to the local
! 46: stack for all functions, and making sure that normal local variables
! 47: are 4 bytes lower on the stack then they would otherwise have been. */
! 48:
! 49: #define STARTING_FRAME_OFFSET (-4)
! 50:
1.1.1.2 root 51: #define __MAIN_NAME " main ("
52: /*
53: * The MAYBE_VMS_FUNCTION_PROLOGUE macro works for both gcc and g++. It
54: * first checks to see if the current routine is "main", which will only
55: * happen for GCC, and add the jsb if it is. If is not the case then try and
56: * see if __MAIN_NAME is part of current_function_name, which will only happen
57: * if we are running g++, and add the jsb if it is. In gcc there should never
58: * be a space in the function name, and in g++ there is always a "(" in the
59: * function name, thus there should never be any confusion.
60: */
1.1 root 61: #define MAYBE_VMS_FUNCTION_PROLOGUE(FILE) \
62: { extern char *current_function_name; \
63: if (!strcmp ("main", current_function_name)) \
1.1.1.3 ! root 64: fprintf(FILE, "\tjsb _C$MAIN_ARGS\n"); \
1.1.1.2 root 65: else { \
66: char *p = current_function_name; \
67: while (*p != '\0') \
68: if (*p == *__MAIN_NAME) \
69: if (strncmp(p, __MAIN_NAME, (sizeof __MAIN_NAME)-1) == 0) {\
1.1.1.3 ! root 70: fprintf(FILE, "\tjsb _C$MAIN_ARGS\n");\
1.1.1.2 root 71: break; \
72: } else \
73: p++; \
74: else \
75: p++; \
76: }; \
77: }
1.1 root 78:
79: #define ASM_OUTPUT_EXTERNAL(FILE,DECL,NAME) \
80: { if (DECL_INITIAL (DECL) == 0 && TREE_CODE (DECL) != FUNCTION_DECL) \
1.1.1.2 root 81: { \
82: if (TREE_READONLY (decl) && ! TREE_VOLATILE (decl)) \
83: const_section (); \
84: else \
85: data_section (); \
86: fputs (".comm ", (FILE)); \
87: assemble_name ((FILE), (NAME)); \
88: fprintf ((FILE), ",0\n"); \
89: } \
90: }
91:
92: #define NO_DOLLAR_IN_LABEL
93:
94: #define EXTRA_SECTIONS in_const
95:
96: #define EXTRA_SECTION_FUNCTIONS \
97: const_section () \
98: { \
99: if (in_section != in_const) { \
100: fprintf(asm_out_file,".const\n"); \
101: in_section = in_const; \
102: } \
103: }
104:
105: #define SELECT_SECTION(T) \
106: { \
107: if (TREE_CODE (T) == VAR_DECL) \
108: { \
109: if (TREE_READONLY (T) && ! TREE_VOLATILE (T)) \
110: { \
111: if (TREE_PUBLIC (T)) \
112: const_section (); \
113: else \
114: text_section (); \
115: } \
116: else \
117: data_section (); \
118: } \
119: if (*tree_code_type[(int) TREE_CODE (T)] == 'c') \
120: { \
121: if ((TREE_CODE (T) == STRING_CST && flag_writable_strings)) \
122: data_section (); \
123: else \
124: text_section (); \
125: } \
126: }
127:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.