2011-11-07 Tristan Gingold <gingold@adacore.com>
authorgingold <gingold@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Nov 2011 09:03:20 +0000 (09:03 +0000)
committergingold <gingold@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Nov 2011 09:03:20 +0000 (09:03 +0000)
* config/alpha/vms.h (TARGET_OBJECT_SUFFIX,
TARGET_EXECUTABLE_SUFFIX, TARGET_OS_CPP_BUILTINS,
TARGET_ABI_OPEN_VMS, LONG_TYPE_SIZE, ADA_LONG_TYPE_SIZE,
POINTER_SIZE, POINTERS_EXTEND_UNSIGNED): Move to config/vms/vms.h
(SUBTARGET_OS_CPP_BUILTINS): Define.
(TARGET_DEFAULT): Tune according to POINTER_SIZE.
(MASK_RETURN_ADDR): Define in 64 bit mode.
* config/ia64/vms.h: Likewise.
* config/vms/vms.h: New file.
* config/vms/vms64.h: New file.
* config/alpha/vms64.h: Removed.
* config/ia64/vms64.h: Removed.
* config.gcc (alpha64-dec-*vms*, alpha*-dec-*vms*, ia64-hp-*vms*):
Adjust for above change.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181078 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config.gcc
gcc/config/alpha/vms.h
gcc/config/alpha/vms64.h [deleted file]
gcc/config/ia64/vms.h
gcc/config/vms/vms.h [new file with mode: 0644]
gcc/config/vms/vms64.h [moved from gcc/config/ia64/vms64.h with 55% similarity]

index 95809a3..632528b 100644 (file)
@@ -1,4 +1,21 @@
-2011-11-07  Sergey Ostanevich  <sergos.gnu@gmail.com>
+2011-11-07  Tristan Gingold  <gingold@adacore.com>
+
+       * config/alpha/vms.h (TARGET_OBJECT_SUFFIX,
+       TARGET_EXECUTABLE_SUFFIX, TARGET_OS_CPP_BUILTINS,
+       TARGET_ABI_OPEN_VMS, LONG_TYPE_SIZE, ADA_LONG_TYPE_SIZE,
+       POINTER_SIZE, POINTERS_EXTEND_UNSIGNED): Move to config/vms/vms.h
+       (SUBTARGET_OS_CPP_BUILTINS): Define.
+       (TARGET_DEFAULT): Tune according to POINTER_SIZE.
+       (MASK_RETURN_ADDR): Define in 64 bit mode.
+       * config/ia64/vms.h: Likewise.
+       * config/vms/vms.h: New file.
+       * config/vms/vms64.h: New file.
+       * config/alpha/vms64.h: Removed.
+       * config/ia64/vms64.h: Removed.
+       * config.gcc (alpha64-dec-*vms*, alpha*-dec-*vms*, ia64-hp-*vms*):
+       Adjust for above change.
+
+ 2011-11-07  Sergey Ostanevich  <sergos.gnu@gmail.com>
 
        PR rtl-optimization/47698
        * ifconv.c (noce_operand_ok): prevent CMOV generation
index 8e4067d..ce97c89 100644 (file)
@@ -790,12 +790,12 @@ alpha*-dec-osf5.1*)
        esac
        ;;
 alpha64-dec-*vms*)
-       tm_file="${tm_file} alpha/vms.h alpha/vms64.h"
+       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} alpha/vms.h"
+       tm_file="${tm_file} vms/vms.h alpha/vms.h"
        xm_file="alpha/xm-vms.h"
        tmake_file="${tmake_file} alpha/t-vms"
        ;;
@@ -1528,7 +1528,7 @@ ia64*-*-hpux*)
        esac
        ;;
 ia64-hp-*vms*)
-       tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h ia64/vms.h ia64/vms64.h"
+       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"
        target_cpu_default="0"
index b6aa802..32794c8 100644 (file)
@@ -19,9 +19,6 @@ 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/>.  */
 
-#define TARGET_OBJECT_SUFFIX ".obj"
-#define TARGET_EXECUTABLE_SUFFIX ".exe"
-
 /* Alpha/VMS object format is not really Elf, but this makes compiling
    crtstuff.c and dealing with shared library initialization much easier.  */
 #define OBJECT_FORMAT_ELF
@@ -33,37 +30,26 @@ along with GCC; see the file COPYING3.  If not see
 
 #define NO_EXTERNAL_INDIRECT_ADDRESS
 
-#define TARGET_OS_CPP_BUILTINS()               \
+#define SUBTARGET_OS_CPP_BUILTINS()            \
     do {                                       \
-       builtin_define_std ("vms");             \
-       builtin_define_std ("VMS");             \
-       builtin_define ("__ALPHA");             \
-       builtin_assert ("system=vms");          \
-       if (TARGET_FLOAT_VAX)                   \
-         builtin_define ("__G_FLOAT");         \
-       else                                    \
-         builtin_define ("__IEEE_FLOAT");      \
+      builtin_define ("__ALPHA");              \
+      if (TARGET_FLOAT_VAX)                    \
+        builtin_define ("__G_FLOAT");          \
+      else                                     \
+        builtin_define ("__IEEE_FLOAT");       \
     } while (0)
 
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_FPREGS|MASK_GAS)
-#undef TARGET_ABI_OPEN_VMS
-#define TARGET_ABI_OPEN_VMS 1
+#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"
 
 #undef PCC_STATIC_STRUCT_RETURN
 
-/* "long" is 32 bits, but 64 bits for Ada.  */
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 32
-#define ADA_LONG_TYPE_SIZE 64
-
-/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended.  */
-#undef POINTER_SIZE
-#define POINTER_SIZE 32
-#define POINTERS_EXTEND_UNSIGNED 0
-
 #define MAX_OFILE_ALIGNMENT 524288  /* 8 x 2^16 by DEC Ada Test CD40VRA */
 
 /* The maximum alignment 'malloc' honors.  */
@@ -170,6 +156,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
+
 #undef  ASM_WEAKEN_LABEL
 #define ASM_WEAKEN_LABEL(FILE, NAME)                            \
    do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME);  \
diff --git a/gcc/config/alpha/vms64.h b/gcc/config/alpha/vms64.h
deleted file mode 100644 (file)
index 495d3c6..0000000
+++ /dev/null
@@ -1,51 +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 TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS()                \
-    do {                                        \
-        builtin_define_std ("vms");             \
-        builtin_define_std ("VMS");             \
-        builtin_define ("__ALPHA");             \
-        builtin_assert ("system=vms");          \
-        builtin_define ("__IEEE_FLOAT");        \
-        builtin_define ("__LONG_POINTERS=1");   \
-    } while (0)
-
-#undef SUBTARGET_SWITCHES
-#define SUBTARGET_SWITCHES \
-  { "malloc64",    MASK_MALLOC64,     "Malloc data into P2 space" },
-
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_FPREGS | MASK_GAS | MASK_MALLOC64)
-
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 64
-
-#undef POINTER_SIZE
-#define POINTER_SIZE 64
-
-/* Eventhough pointers are 64bits, only 32bit ever remain significant in code
-   addresses.  */
-#define MASK_RETURN_ADDR (GEN_INT (0xffffffff))
-
-/* Defaults to "long int" */
-#undef SIZE_TYPE
-#undef PTRDIFF_TYPE
index 853e023..75ea4ad 100644 (file)
@@ -18,42 +18,24 @@ 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/>.  */
 
-#define TARGET_OBJECT_SUFFIX ".obj"
-#define TARGET_EXECUTABLE_SUFFIX ".exe"
-
 #define OBJECT_FORMAT_ELF
 
-#define TARGET_OS_CPP_BUILTINS()               \
+#define SUBTARGET_OS_CPP_BUILTINS()            \
     do {                                       \
-       builtin_define_std ("vms");             \
-       builtin_define_std ("VMS");             \
        builtin_define ("__IA64");              \
-       builtin_assert ("system=vms");          \
        builtin_define ("__IEEE_FLOAT");        \
     } while (0)
 
-/* By default, allow $ to be part of an identifier.  */
-#define DOLLARS_IN_IDENTIFIERS 2
-
-#undef TARGET_ABI_OPEN_VMS
-#define TARGET_ABI_OPEN_VMS 1
-
 /* 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"
 
-/* "long" is 32 bits, but 64 bits for Ada.  */
-#undef LONG_TYPE_SIZE
-#define LONG_TYPE_SIZE 32
-#define ADA_LONG_TYPE_SIZE 64
-
-/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended.  */
-#undef POINTER_SIZE
-#define POINTER_SIZE 32
-#define POINTERS_EXTEND_UNSIGNED 0
-
 #undef MAX_OFILE_ALIGNMENT
 #define MAX_OFILE_ALIGNMENT 524288  /* 8 x 2^16 by DEC Ada Test CD40VRA */
 
diff --git a/gcc/config/vms/vms.h b/gcc/config/vms/vms.h
new file mode 100644 (file)
index 0000000..a69c7c7
--- /dev/null
@@ -0,0 +1,57 @@
+/* Definitions of target machine GNU compiler. VMS common version.
+   Copyright (C) 2003-2009,2011 Free Software Foundation, Inc.
+   Contributed by Douglas B 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/>.  */
+
+#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");        \
+      }                                              \
+  } while (0)
+
+/* By default, allow $ to be part of an identifier.  */
+#define DOLLARS_IN_IDENTIFIERS 2
+
+#undef TARGET_ABI_OPEN_VMS
+#define TARGET_ABI_OPEN_VMS 1
+
+/* "long" is 32 bits, but 64 bits for Ada.  */
+#undef LONG_TYPE_SIZE
+#define LONG_TYPE_SIZE 32
+#define ADA_LONG_TYPE_SIZE 64
+
+/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended.  */
+#undef POINTER_SIZE
+#define POINTER_SIZE 32
+#define POINTERS_EXTEND_UNSIGNED 0
+
+/* Always 32 bits.  */
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
similarity index 55%
rename from gcc/config/ia64/vms64.h
rename to gcc/config/vms/vms64.h
index a920143..24249ce 100644 (file)
@@ -1,6 +1,6 @@
-/* Definitions of target machine GNU compiler. 64bit IA64-VMS version.
-   Copyright (C) 2004-2009 Free Software Foundation, Inc.
-   Contributed by Douglas Rupp (rupp@gnat.com).
+/* 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.
 
@@ -18,22 +18,12 @@ 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 TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS()               \
-    do {                                       \
-       builtin_define_std ("vms");             \
-       builtin_define_std ("VMS");             \
-       builtin_define ("__IA64");              \
-       builtin_assert ("system=vms");          \
-       builtin_define ("__IEEE_FLOAT");        \
-       builtin_define ("__LONG_POINTERS=1");   \
-    } while (0)
-
 #undef LONG_TYPE_SIZE
 #define LONG_TYPE_SIZE 64
 
 #undef POINTER_SIZE
 #define POINTER_SIZE 64
 
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_DWARF2_ASM | MASK_GNU_AS | MASK_MALLOC64)
+/* Defaults to "long int" */
+#undef SIZE_TYPE
+#undef PTRDIFF_TYPE