]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2012-03-12 Tristan Gingold <gingold@adacore.com>
authorgingold <gingold@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Mar 2012 11:58:16 +0000 (11:58 +0000)
committergingold <gingold@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Mar 2012 11:58:16 +0000 (11:58 +0000)
* 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

17 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/gigi.h
gcc/config.gcc
gcc/config/alpha/vms.h
gcc/config/ia64/vms.h
gcc/config/vms/vms-c.c
gcc/config/vms/vms-opts.h [new file with mode: 0644]
gcc/config/vms/vms-protos.h
gcc/config/vms/vms.c
gcc/config/vms/vms.h
gcc/config/vms/vms.opt
gcc/config/vms/vms64.h [deleted file]
libgcc/ChangeLog
libgcc/config/alpha/t-vms
libgcc/config/ia64/t-vms

index a408ce7aef5f4be04b4006388f0bf49cf311e537..faddb0bcb7aac2231f824a1438fadfb69c713d7e 100644 (file)
@@ -1,3 +1,34 @@
+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
index 61dc3bef1996fe22f185589866188212cbeb2897..3989168aaa76aab00f4d9182e267800b1e357908 100644 (file)
@@ -1,3 +1,10 @@
+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.
index 34183bac2ff0442b0453690dd03004dd47dcbb4b..120628e4765e4ae54517e44940e68edb6e4983ab 100644 (file)
@@ -5488,7 +5488,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
 
   /* 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),
index 5e6495ad27cff50bab2ccdcbe5f08342d1270edd..f7d787bb012ddb91fb7b343b8d3378f9edcfe66a 100644 (file)
@@ -999,13 +999,11 @@ extern void enumerate_modes (void (*f) (const char *, int, int, int, int, int,
    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.  */
index 2ec414586507c446e75b9929da0096a39db20424..aa30518d254521315472902bc08da5bc9bdf8221 100644 (file)
@@ -737,6 +737,7 @@ case ${target} in
   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
@@ -811,14 +812,8 @@ alpha*-dec-osf5.1*)
            ;;
        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)
@@ -1556,9 +1551,8 @@ ia64*-*-hpux*)
        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
index a84c15e063b40dae9f4e76dbe3d89a69ae2d4b4c..2422da942d733891db4409ee430d995be11f4f8b 100644 (file)
@@ -44,11 +44,7 @@ along with GCC; see the file COPYING3.  If not see
     } 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"
 
@@ -58,7 +54,9 @@ along with GCC; see the file COPYING3.  If not see
 
 /* 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  \
@@ -160,11 +158,12 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
 
 #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)                            \
index e847a0fc500d783918a4c378fb12338ab84a2a39..0c02f8a2338b8d242bb47f3246205a6b69d8aa02 100644 (file)
@@ -28,11 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 
 /* 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"
 
index 4377eac04ad10bfbb0f222e29f5ed26dd5b35606..229846a0bf6b0df1c27adddce214d7254fa6772c 100644 (file)
@@ -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 (file)
index 0000000..979ff75
--- /dev/null
@@ -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
index a7ca3469cdb8ecc3b6a2eade19fc6ea7a06ba621..a8b9adad81c82edcfcd890bf9dd5b7618125e877 100644 (file)
@@ -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);
index 64185365a137ac084f7b6bd0bde8882606473930..4a7386f1c0824f6caef7a6317df14b651fcb56af 100644 (file)
@@ -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);
 
index ab8f6e0dc4ed4a69ddf61e865c52ce64f3768e05..e11b1bf4f175c53e092aa29bc25d937463451089 100644 (file)
@@ -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
index a1713b8115419df5ae44a48730bab295832e251b..4afe6345d7aedbab481902fcf622cdf9d8c4a5ec 100644 (file)
 ; 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 (file)
index 24249ce..0000000
+++ /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
index fd60295f760573fb30f1593de00d0d5301df39ef..4ce3398147919e5aa0ad4c00eb3bc5a46f4a26b9 100644 (file)
@@ -1,3 +1,8 @@
+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
index dd5760d9747293efa8fea9dd7f6b5098b448aa17..870e44c8dd111d271d84c56414019a259d23a0a3 100644 (file)
@@ -7,3 +7,5 @@ vms-dwarf2eh.o: $(srcdir)/config/alpha/vms-dwarf2eh.S
        $(gcc_compile) -c -x assembler-with-cpp $<
 
 LIB2ADD += $(srcdir)/config/alpha/vms-gcc_shell_handler.c
+
+HOST_LIBGCC2_CFLAGS=-mpointer-size=64
index 140c748b771905ef02b583c0c8b0d4cb590b2d9b..e95c58d8b50172c2c325766d3e2286a29f08f793 100644 (file)
@@ -5,3 +5,5 @@ crtinitS.o: $(srcdir)/config/ia64/vms-crtinit.S
        $(gcc_compile) -c -x assembler-with-cpp $<
 
 LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
+
+HOST_LIBGCC2_CFLAGS=-mpointer-size=64