diff options
author | Tristan Gingold <gingold@adacore.com> | 2012-03-12 11:58:16 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@gcc.gnu.org> | 2012-03-12 11:58:16 +0000 |
commit | d8aba32a0959169d00b9d89b28f6d4ccc4763be8 (patch) | |
tree | 6fb6df38c14e64460a642d25c2d284aef453c48a /gcc/config/vms | |
parent | 10ee90e9fe6751acde4f9de329eeb8c4460cf39d (diff) | |
download | gcc-d8aba32a0959169d00b9d89b28f6d4ccc4763be8.zip gcc-d8aba32a0959169d00b9d89b28f6d4ccc4763be8.tar.gz gcc-d8aba32a0959169d00b9d89b28f6d4ccc4763be8.tar.bz2 |
vms.opt: Add vms-opts.h header.
2012-03-12 Tristan Gingold <gingold@adacore.com>
* config/vms/vms.opt: Add vms-opts.h header.
(mmalloc64): Use flag_vms_malloc64 flag instead of MALLOC64
target mask.
(-mvms-return-codes): Document.
(-mpointer-size): New option.
(vms_pointer_size): Add enumeration.
* config/vms/vms-opts.h: New file.
* config/vms/vms.h (TARGET_OS_CPP_BUILTINS): Define
__INITIAL_POINTER_SIZE.
(POINTER_SIZE, SIZE_TYPE, PTRDIFF_TYPE): Adjust definition.
(C_COMMON_OVERRIDE_OPTIONS): Define.
(DWARF2_ADDR_SIZE): Define.
* config/vms/vms.c (vms_patch_builtins): Adjust condition.
* config/vms/vms-protos.h (vms_c_common_override_options):
New prototype.
* config/vms/vms-c.c (vms_pragma_pointer_size): Ignore pragma
if -mno-pointer-size.
(vms_c_common_override_options): New function.
* config/ia64/vms.h (TARGET_DEFAULT): Remove MASK_MALLOC64.
* config/alpha/vms.h (TARGET_DEFAULT): Remove MASK_MALLOC64.
(MALLOC_ABI_ALIGNMENT): Use flag_vms_malloc64
and flag_vms_pointer_size.
(MASK_RETURN_ADDR): Set according to flag_vms_pointer_size.
* config.gcc (*-*-*vms*): Define xm_file.
(alpha*-dec-*vms*): Do not define xm_file.
(alpha64-dec-*vms*): Remove.
(ia64-hp-*vms*): Do not define xm_file. Simplify tm_file
and tmake_file.
libgcc/
2012-03-12 Tristan Gingold <gingold@adacore.com>
* config/alpha/t-vms: Define HOST_LIBGCC2_CFLAGS.
* config/ia64/t-vms: Likewise.
gcc/ada/
2012-03-12 Tristan Gingold <gingold@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_param): Use flag_vms_malloc64
instead of TARGET_MALLOC64.
* gcc-interface/gigi.h (flag_vms_malloc64): Define instead
of TARGET_MALLOC64.
From-SVN: r185224
Diffstat (limited to 'gcc/config/vms')
-rw-r--r-- | gcc/config/vms/vms-c.c | 21 | ||||
-rw-r--r-- | gcc/config/vms/vms-opts.h | 31 | ||||
-rw-r--r-- | gcc/config/vms/vms-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/vms/vms.c | 6 | ||||
-rw-r--r-- | gcc/config/vms/vms.h | 42 | ||||
-rw-r--r-- | gcc/config/vms/vms.opt | 32 | ||||
-rw-r--r-- | gcc/config/vms/vms64.h | 29 |
7 files changed, 112 insertions, 50 deletions
diff --git a/gcc/config/vms/vms-c.c b/gcc/config/vms/vms-c.c index 4377eac..229846a 100644 --- a/gcc/config/vms/vms-c.c +++ b/gcc/config/vms/vms-c.c @@ -335,8 +335,8 @@ handle_pragma_pointer_size (const char *pragma_name) static void vms_pragma_pointer_size (cpp_reader * ARG_UNUSED (dummy)) { - /* Ignore if 32 bit only. */ - if (POINTER_SIZE != 64) + /* Ignore if no -mpointer-size option. */ + if (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE) return; handle_pragma_pointer_size ("pointer_size"); @@ -449,3 +449,20 @@ vms_c_register_includes (const char *sysroot, } } } + +void +vms_c_common_override_options (void) +{ + /* Initialize c_default_pointer_mode. */ + switch (flag_vms_pointer_size) + { + case VMS_POINTER_SIZE_NONE: + break; + case VMS_POINTER_SIZE_32: + c_default_pointer_mode = SImode; + break; + case VMS_POINTER_SIZE_64: + c_default_pointer_mode = DImode; + break; + } +} diff --git a/gcc/config/vms/vms-opts.h b/gcc/config/vms/vms-opts.h new file mode 100644 index 0000000..979ff75 --- /dev/null +++ b/gcc/config/vms/vms-opts.h @@ -0,0 +1,31 @@ +/* Definitions for option handling for OpenVMS. + Copyright (C) 2012 + Free Software Foundation, Inc. + + This file is part of GCC. + + 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 3, or (at your + option) any later version. + + 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 GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#ifndef VMS_OPTS_H +#define VMS_OPTS_H + +enum vms_pointer_size + { + VMS_POINTER_SIZE_NONE, + VMS_POINTER_SIZE_32, + VMS_POINTER_SIZE_64 + }; + +#endif diff --git a/gcc/config/vms/vms-protos.h b/gcc/config/vms/vms-protos.h index a7ca346..a8b9ada 100644 --- a/gcc/config/vms/vms-protos.h +++ b/gcc/config/vms/vms-protos.h @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see /* vms-c.c */ extern void vms_c_register_pragma (void); +extern void vms_c_common_override_options (void); /* vms.c */ void vms_patch_builtins (void); diff --git a/gcc/config/vms/vms.c b/gcc/config/vms/vms.c index 6418536..4a7386f 100644 --- a/gcc/config/vms/vms.c +++ b/gcc/config/vms/vms.c @@ -160,9 +160,11 @@ vms_patch_builtins (void) alt[1 + nlen + 2] = 0; vms_add_crtl_xlat (alt, nlen + 3, res, rlen + nlen); - use_64 = (((n->flags & VMS_CRTL_64) && POINTER_SIZE == 64) + use_64 = (((n->flags & VMS_CRTL_64) + && flag_vms_pointer_size == VMS_POINTER_SIZE_64) || ((n->flags & VMS_CRTL_MALLOC) - && TARGET_MALLOC64)); + && flag_vms_malloc64 + && flag_vms_pointer_size != VMS_POINTER_SIZE_NONE)); if (!use_64) vms_add_crtl_xlat (n->name, nlen, res, rlen + nlen); diff --git a/gcc/config/vms/vms.h b/gcc/config/vms/vms.h index ab8f6e0..e11b1bf 100644 --- a/gcc/config/vms/vms.h +++ b/gcc/config/vms/vms.h @@ -21,17 +21,19 @@ along with GCC; see the file COPYING3. If not see #define TARGET_OBJECT_SUFFIX ".obj" #define TARGET_EXECUTABLE_SUFFIX ".exe" -#define TARGET_OS_CPP_BUILTINS() \ - do { \ - builtin_define_std ("vms"); \ - builtin_define_std ("VMS"); \ - builtin_assert ("system=vms"); \ - SUBTARGET_OS_CPP_BUILTINS(); \ - if (POINTER_SIZE == 64) \ - { \ - builtin_define ("__LONG_POINTERS=1"); \ - builtin_define ("__int64=long long"); \ - } \ +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define_std ("vms"); \ + builtin_define_std ("VMS"); \ + builtin_assert ("system=vms"); \ + SUBTARGET_OS_CPP_BUILTINS(); \ + builtin_define ("__int64=long long"); \ + if (flag_vms_pointer_size == VMS_POINTER_SIZE_32) \ + builtin_define ("__INITIAL_POINTER_SIZE=32"); \ + else if (flag_vms_pointer_size == VMS_POINTER_SIZE_64) \ + builtin_define ("__INITIAL_POINTER_SIZE=64"); \ + if (POINTER_SIZE == 64) \ + builtin_define ("__LONG_POINTERS=1"); \ } while (0) extern void vms_c_register_includes (const char *, const char *, int); @@ -53,15 +55,25 @@ extern void vms_c_register_includes (const char *, const char *, int); /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */ #undef POINTER_SIZE -#define POINTER_SIZE 32 +#define POINTER_SIZE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? 32 : 64) #define POINTERS_EXTEND_UNSIGNED 0 -/* Always 32 bits. */ +/* FIXME: It should always be a 32 bit type. */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? \ + "unsigned int" : "long long unsigned int") +/* ???: Defined as a 'int' by dec-c, but obstack.h doesn't like it. */ #undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" +#define PTRDIFF_TYPE (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE ? \ + "int" : "long long int") + +#define C_COMMON_OVERRIDE_OPTIONS vms_c_common_override_options () /* VMS doesn't support other sections than .text for code. */ #define TARGET_ASM_FUNCTION_SECTION vms_function_section + +/* Always use 8 bytes addresses in dwarf2 debug info. The default value doesn't + work as it may be 4 bytes, which won't match gas default (8 bytes for ia64), + and will thus produce incorrect values. */ +#define DWARF2_ADDR_SIZE 8 diff --git a/gcc/config/vms/vms.opt b/gcc/config/vms/vms.opt index a1713b8..4afe634 100644 --- a/gcc/config/vms/vms.opt +++ b/gcc/config/vms/vms.opt @@ -16,11 +16,14 @@ ; along with GCC; see the file COPYING3. If not see ; <http://www.gnu.org/licenses/>. +HeaderInclude +config/vms/vms-opts.h + map Target RejectNegative mmalloc64 -Target Report Mask(MALLOC64) +Target Report Var(flag_vms_malloc64) Init(1) Malloc data into P2 space mdebug-main= @@ -28,4 +31,29 @@ Target RejectNegative Joined Var(vms_debug_main) Set name of main routine for the debugger mvms-return-codes -Target RejectNegative +Target Report Var(flag_vms_return_codes) +Use VMS exit codes instead of posix ones + +mpointer-size= +Target Joined Report RejectNegative Enum(vms_pointer_size) Var(flag_vms_pointer_size) Init(VMS_POINTER_SIZE_NONE) +-mpointer-size=[no,32,short,64,long] Set the default pointer size + +Enum +Name(vms_pointer_size) Type(enum vms_pointer_size) UnknownError(unknown pointer size model %qs) + +EnumValue +Enum(vms_pointer_size) String(no) Value(VMS_POINTER_SIZE_NONE) + +EnumValue +Enum(vms_pointer_size) String(32) Value(VMS_POINTER_SIZE_32) + +EnumValue +Enum(vms_pointer_size) String(short) Value(VMS_POINTER_SIZE_32) + +EnumValue +Enum(vms_pointer_size) String(64) Value(VMS_POINTER_SIZE_64) + +EnumValue +Enum(vms_pointer_size) String(long) Value(VMS_POINTER_SIZE_64) + +; This comment is to ensure we retain the blank line above. diff --git a/gcc/config/vms/vms64.h b/gcc/config/vms/vms64.h deleted file mode 100644 index 24249ce..0000000 --- a/gcc/config/vms/vms64.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Output variables, constants and external declarations, for GNU compiler. - Copyright (C) 2001, 2007, 2009 Free Software Foundation, Inc. - Contributed by Douglas Rupp (rupp@gnat.com). - -This file is part of GCC. - -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 3, or (at your option) -any later version. - -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 GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ - -#undef LONG_TYPE_SIZE -#define LONG_TYPE_SIZE 64 - -#undef POINTER_SIZE -#define POINTER_SIZE 64 - -/* Defaults to "long int" */ -#undef SIZE_TYPE -#undef PTRDIFF_TYPE |