* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185224
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2012-03-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51721
+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.
+
2012-03-09 Robert Dewar <dewar@adacore.com>
* a-direct.adb, comperr.adb, freeze.adb: Minor reformatting.
/* VMS descriptors are themselves passed by reference. */
if (mech == By_Short_Descriptor ||
- (mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !TARGET_MALLOC64))
+ (mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !flag_vms_malloc64))
gnu_param_type
= build_pointer_type (build_vms_descriptor32 (gnu_param_type,
Mechanism (gnat_param),
intrusive preprocessor directives. */
#ifndef TARGET_ABI_OPEN_VMS
#define TARGET_ABI_OPEN_VMS 0
-#endif
-/* VMS macro set by default, when clear forces 32bit mallocs and 32bit
+/* VMS option set by default, when clear forces 32bit mallocs and 32bit
Descriptors. Always used in combination with TARGET_ABI_OPEN_VMS
so no effect on non-VMS systems. */
-#ifndef TARGET_MALLOC64
-#define TARGET_MALLOC64 0
+#define flag_vms_malloc64 0
#endif
/* Convenient shortcuts. */
extra_objs="vms.o"
target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
tm_p_file="${tm_p_file} vms/vms-protos.h"
+ xm_file="vms/xm-vms.h"
c_target_objs="vms-c.o"
cxx_target_objs="vms-c.o"
if test x$gnu_ld != xyes; then
;;
esac
;;
-alpha64-dec-*vms*)
- tm_file="${tm_file} vms/vms.h vms/vms64.h alpha/vms.h"
- xm_file="alpha/xm-vms.h vms/xm-vms64.h"
- tmake_file="${tmake_file} vms/t-vms64 alpha/t-vms"
- ;;
alpha*-dec-*vms*)
tm_file="${tm_file} vms/vms.h alpha/vms.h"
- xm_file="alpha/xm-vms.h"
tmake_file="${tmake_file} alpha/t-vms"
;;
arm-wrs-vxworks)
esac
;;
ia64-hp-*vms*)
- tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h vms/vms.h vms/vms64.h ia64/vms.h"
- xm_file="vms/xm-vms.h vms/xm-vms64.h"
- tmake_file="${tmake_file} vms/t-vms64 ia64/t-ia64"
+ tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h"
+ tmake_file="${tmake_file} ia64/t-ia64"
target_cpu_default="0"
if test x$gas = xyes
then
} while (0)
#undef TARGET_DEFAULT
-#if POINTER_SIZE == 64
-#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS | MASK_MALLOC64)
-#else
#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS)
-#endif
#define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
/* The maximum alignment 'malloc' honors. */
#undef MALLOC_ABI_ALIGNMENT
-#define MALLOC_ABI_ALIGNMENT ((TARGET_MALLOC64 ? 16 : 8) * BITS_PER_UNIT)
+#define MALLOC_ABI_ALIGNMENT \
+ ((flag_vms_malloc64 && flag_vms_pointer_size != VMS_POINTER_SIZE_NONE \
+ ? 16 : 8) * BITS_PER_UNIT)
#undef FIXED_REGISTERS
#define FIXED_REGISTERS \
#define DEFAULT_PCC_STRUCT_RETURN 0
-#if POINTER_SIZE == 64
/* Eventhough pointers are 64bits, only 32bit ever remain significant in code
addresses. */
-#define MASK_RETURN_ADDR (GEN_INT (0xffffffff))
-#endif
+#define MASK_RETURN_ADDR \
+ (flag_vms_pointer_size == VMS_POINTER_SIZE_NONE \
+ ? constm1_rtx \
+ : GEN_INT (0xffffffff))
#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE, NAME) \
/* Need .debug_line info generated from gcc and gas. */
#undef TARGET_DEFAULT
-#if POINTER_SIZE == 64
-#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_MALLOC64)
-#else
#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS)
-#endif
#define VMS_DEBUG_MAIN_POINTER "TRANSFER$BREAK$GO"
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");
}
}
}
+
+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;
+ }
+}
--- /dev/null
+/* 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
/* 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);
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);
#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);
/* 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
; 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=
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.
+++ /dev/null
-/* 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
+2012-03-12 Tristan Gingold <gingold@adacore.com>
+
+ * config/alpha/t-vms: Define HOST_LIBGCC2_CFLAGS.
+ * config/ia64/t-vms: Likewise.
+
2012-03-11 Michael Hope <michael.hope@linaro.org>
* longlong.h [ARM] (add_ssaaaa, sub_ddmmss, umul_ppmm): Enable
$(gcc_compile) -c -x assembler-with-cpp $<
LIB2ADD += $(srcdir)/config/alpha/vms-gcc_shell_handler.c
+
+HOST_LIBGCC2_CFLAGS=-mpointer-size=64
$(gcc_compile) -c -x assembler-with-cpp $<
LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
+
+HOST_LIBGCC2_CFLAGS=-mpointer-size=64