aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-19 08:14:23 +0000
committerRichard Stallman <rms@gnu.org>1993-06-19 08:14:23 +0000
commit9f323d310f21994e9656096365dcc3375ce92035 (patch)
tree1713b8407af5d27da976acafd280584aefb21dc7 /gcc
parentadb65c99a624941344020ad77a866c0f4509de7d (diff)
downloadgcc-9f323d310f21994e9656096365dcc3375ce92035.zip
gcc-9f323d310f21994e9656096365dcc3375ce92035.tar.gz
gcc-9f323d310f21994e9656096365dcc3375ce92035.tar.bz2
(MAYBE_VMS_FUNCTION_PROLOGUE): adjust stack pointer by 4 prior to calling C$MAIN_ARGS...
(MAYBE_VMS_FUNCTION_PROLOGUE): adjust stack pointer by 4 prior to calling C$MAIN_ARGS, otherwise POSIX edition of that routine dies. From-SVN: r4697
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/vax/vms.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/gcc/config/vax/vms.h b/gcc/config/vax/vms.h
index 481e3bf..a52e8d5 100644
--- a/gcc/config/vax/vms.h
+++ b/gcc/config/vax/vms.h
@@ -95,23 +95,27 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
* if we are running g++, and add the jsb if it is. In gcc there should never
* be a space in the function name, and in g++ there is always a "(" in the
* function name, thus there should never be any confusion.
+ *
+ * Adjusting the stack pointer by 4 before calling C$MAIN_ARGS is required
+ * when linking with the VMS POSIX version of the C run-time library; using
+ * `subl2 $4,r0' is adequate but we use `clrl -(sp)' instead. The extra 4
+ * bytes could be removed after the call because STARTING_FRAME_OFFSET's
+ * setting of -4 will end up adding them right back again, but don't bother.
*/
#define MAYBE_VMS_FUNCTION_PROLOGUE(FILE) \
{ extern char *current_function_name; \
- if (!strcmp ("main", current_function_name)) \
- fprintf(FILE, "\tjsb _C$MAIN_ARGS\n"); \
- else { \
- char *p = current_function_name; \
- while (*p != '\0') \
- if (*p == *__MAIN_NAME) \
- if (strncmp(p, __MAIN_NAME, (sizeof __MAIN_NAME)-1) == 0) {\
- fprintf(FILE, "\tjsb _C$MAIN_ARGS\n");\
- break; \
- } else \
- p++; \
- else \
- p++; \
- }; \
+ char *p = current_function_name; \
+ int is_main = strcmp ("main", p) == 0; \
+ while (!is_main && *p != '\0') \
+ { \
+ if (*p == *__MAIN_NAME \
+ && strncmp (p, __MAIN_NAME, sizeof __MAIN_NAME - sizeof "") == 0) \
+ is_main = 1; \
+ else \
+ p++; \
+ } \
+ if (is_main) \
+ fprintf (FILE, "\t%s\n\t%s\n", "clrl -(sp)", "jsb _C$MAIN_ARGS"); \
}
/* This macro definition sets up a default value for `main' to return. */