From patchwork Mon Nov 7 09:05:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 124020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 719E8B6F7E for ; Mon, 7 Nov 2011 20:06:12 +1100 (EST) Received: (qmail 22059 invoked by alias); 7 Nov 2011 09:06:09 -0000 Received: (qmail 22049 invoked by uid 22791); 7 Nov 2011 09:06:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Nov 2011 09:05:53 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 73214CB0253 for ; Mon, 7 Nov 2011 10:05:54 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rl-s7PO9Ts0J for ; Mon, 7 Nov 2011 10:05:44 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 7FD1FCB02C6 for ; Mon, 7 Nov 2011 10:05:30 +0100 (CET) From: Tristan Gingold Subject: [vms,committed]: Consolidate vms config files Date: Mon, 7 Nov 2011 10:05:28 +0100 Message-Id: <77196731-A418-418B-8E31-744EE5F7D48B@adacore.com> To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1251.1) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this patch extract common definitions from alpha/vms.h and ia64/vms.h into vms/vms.h to reduce code duplication. It replaces alpha/vms64.h and ia64/vms64.h by vms/vms.h for the same purpose. Applied on trunk. Tristan. 2011-11-07 Tristan Gingold * 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. Index: config.gcc =================================================================== --- config.gcc (revision 181074) +++ config.gcc (working copy) @@ -790,12 +790,12 @@ 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 @@ 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: config/alpha/vms.h =================================================================== --- config/alpha/vms.h (revision 181074) +++ config/alpha/vms.h (working copy) @@ -19,9 +19,6 @@ along with GCC; see the file COPYING3. If not see . */ -#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 @@ #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 @@ #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); \ Index: config/alpha/vms64.h =================================================================== --- config/alpha/vms64.h (revision 181074) +++ config/alpha/vms64.h (working copy) @@ -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 -. */ - -#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: config/vms/vms64.h =================================================================== --- config/vms/vms64.h (revision 0) +++ config/vms/vms64.h (revision 0) @@ -0,0 +1,29 @@ +/* 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 +. */ + +#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: config/vms/vms.h =================================================================== --- config/vms/vms.h (revision 0) +++ config/vms/vms.h (revision 0) @@ -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 +. */ + +#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" Index: config/ia64/vms.h =================================================================== --- config/ia64/vms.h (revision 181074) +++ config/ia64/vms.h (working copy) @@ -18,42 +18,24 @@ along with GCC; see the file COPYING3. If not see . */ -#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 */ Index: config/ia64/vms64.h =================================================================== --- config/ia64/vms64.h (revision 181074) +++ config/ia64/vms64.h (working copy) @@ -1,39 +0,0 @@ -/* Definitions of target machine GNU compiler. 64bit IA64-VMS version. - Copyright (C) 2004-2009 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 -. */ - -#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)