From patchwork Tue Mar 6 10:45:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 144904 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 8C4C4B6FAA for ; Tue, 6 Mar 2012 21:45:51 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331635553; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-Id:To:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=Qo1qtzu8Da8YkHzPIzJUvC5NVic=; b=sJhXHzywcDs+hRE xw0ntjgPWAhfKHGhxhFftX3Gi0TW4J3umsGuvq1IPcabZvjq/HTUJoSNKm9AQymw 2/0oSSnBwOJVu6m9JZ+FnMXwhx1bmUKxfxekvxfidU/1fIxGihmH+juZxtL5gBCT 39lyEhJtDf9LmPs+ze4KwPbI24lg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-Id:To:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=k4BRpQkxb/CWlE9WdnjmqotO7EwMNLZf6hjQIGn0vNipKCK2JwioosKyzFUhCR 03YRzEmsWaqDTrs8iDyltkvioi5Hl8/QO0AvcZu4inA5hu8URdTNYQq39LwZ+oAi qJEyenaAkRouEQTBaVB9Uq/XNp+dRFA+1NCxVSbzzZox0=; Received: (qmail 31039 invoked by alias); 6 Mar 2012 10:45:44 -0000 Received: (qmail 31030 invoked by uid 22791); 6 Mar 2012 10:45:42 -0000 X-SWARE-Spam-Status: No, hits=-1.7 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; Tue, 06 Mar 2012 10:45:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id E5F1C290052 for ; Tue, 6 Mar 2012 11:45:28 +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 g5bPaM2ctYBO for ; Tue, 6 Mar 2012 11:45:28 +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 D51A4290011 for ; Tue, 6 Mar 2012 11:45:28 +0100 (CET) From: Tristan Gingold Subject: [VMS] minor updates to vms-c.c Date: Tue, 6 Mar 2012 11:45:27 +0100 Message-Id: <53458F40-74EE-4EB0-B4AB-E52EB3085297@adacore.com> To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1257) 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: * handles 'octaword' alignment in pragma __nomember_alignment. * handles 'relaxed_refdef' in pragma __extern_model. * allow preprocessor expansion in pragma nomember_alignment. * improve the documentation of external model. Committed on trunk. Tristan. 2012-03-06 Tristan Gingold * config/vms/vms-c.c (vms_pragma_nomember_alignment): Handle octaword. (external_model_kind): Improve documentation. (vms_pragma_extern_model): Handle relaxed_redef. (vms_c_register_pragma): Allow expansion for nomember_alignment. Index: gcc/config/vms/vms-c.c =================================================================== --- gcc/config/vms/vms-c.c (revision 184981) +++ gcc/config/vms/vms-c.c (working copy) @@ -125,6 +125,8 @@ maximum_field_alignment = 4 * BITS_PER_UNIT; else if (strcmp (arg, "quadword") == 0) maximum_field_alignment = 8 * BITS_PER_UNIT; + else if (strcmp (arg, "octaword") == 0) + maximum_field_alignment = 16 * BITS_PER_UNIT; else { error ("unhandled alignment for '#pragma nomember_alignment'"); @@ -145,17 +147,33 @@ } } -/* The 'extern model' for public data. */ +/* The 'extern model' for public data. This drives how the following + declarations are handled: + 1) extern int name; + 2) int name; + 3) int name = 5; + See below for the behaviour as implemented by the native compiler. +*/ enum extern_model_kind { - /* Create one overlaid section per variable. */ + /* Create one overlaid section per variable. All the above declarations (1, + 2 and 3) are handled the same way: they create an overlaid section named + NAME (and initialized only for 3). No global symbol is created. + This is the VAX C behavior. */ extern_model_common_block, - /* Like unix: multiple not-initialized declarations are allowed. */ + /* Like unix: multiple not-initialized declarations are allowed. + Only one initialized definition (case 3) is allows, but multiple + uninitialize definition (case 2) are allowed. + For case 2, this creates both a section named NAME and a global symbol. + For case 3, this creates a conditional global symbol defenition and a + conditional section definition. + This is the traditional UNIX C behavior. */ extern_model_relaxed_refdef, - /* Like -fno-common. */ + /* Like -fno-common. Only one definition (cases 2 and 3) are allowed. + This is the ANSI-C model. */ extern_model_strict_refdef, /* Declarations creates symbols without storage. */ @@ -192,6 +210,8 @@ saved_extern_model = current_extern_model; else if (strcmp (arg, "restore") == 0) current_extern_model = saved_extern_model; + else if (strcmp (arg, "relaxed_refdef") == 0) + current_extern_model = extern_model_relaxed_refdef; else if (strcmp (arg, "strict_refdef") == 0) current_extern_model = extern_model_strict_refdef; else if (strcmp (arg, "common_block") == 0) @@ -274,10 +294,10 @@ c_register_pragma (NULL, "standard", vms_pragma_standard); c_register_pragma (NULL, "__member_alignment", vms_pragma_member_alignment); c_register_pragma (NULL, "member_alignment", vms_pragma_member_alignment); - c_register_pragma (NULL, "__nomember_alignment", - vms_pragma_nomember_alignment); - c_register_pragma (NULL, "nomember_alignment", - vms_pragma_nomember_alignment); + c_register_pragma_with_expansion (NULL, "__nomember_alignment", + vms_pragma_nomember_alignment); + c_register_pragma_with_expansion (NULL, "nomember_alignment", + vms_pragma_nomember_alignment); c_register_pragma (NULL, "__extern_model", vms_pragma_extern_model); c_register_pragma (NULL, "extern_model", vms_pragma_extern_model); c_register_pragma (NULL, "__message", vms_pragma_message);