From patchwork Wed Jan 25 09:15:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 137723 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 4A427B6F74 for ; Wed, 25 Jan 2012 20:15: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=1328087755; 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=c1NS5iwYMuboJpMVh8yqEiRK3tU=; b=xY78axIMkLxrWFK D1/DKuzPIBfkIf3CBkDK1jcLaP6+Ulp8JCsQR0DuG5VFnqLCjheiP9SRvWSsOaJa e1pgxf+klqI3xmwFtf7bWQffdeK/CTIQC9TQtPq2WZMwMT6GLZi6VfO+6bJhSl9w iqUg0u1eGmhQ3w/9RoI35wB6v2OA= 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=PEE54RGlV5LGLdrRZ84sxzxjnjcmfDKJx4AOqwTlM/JxXnIH6EKE4qX+ROueVF YZZbs7e8uC7wc/jytO7DcHdcr3lPYRr3E0eXybhsY1t9ZXBFyZrsoZHtQxPBl2Av 7R2S4i95/SRdkSGbEXasUYYId1+6Mqs8LkJ+SpNSCOOjw=; Received: (qmail 32692 invoked by alias); 25 Jan 2012 09:15:46 -0000 Received: (qmail 32613 invoked by uid 22791); 25 Jan 2012 09:15:45 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_NV 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; Wed, 25 Jan 2012 09:15:32 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2F9EDCB3FA5 for ; Wed, 25 Jan 2012 10:15:32 +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 E+q7JiRzrynv for ; Wed, 25 Jan 2012 10:15:32 +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 1DCD4CB3BA6 for ; Wed, 25 Jan 2012 10:15:32 +0100 (CET) From: Tristan Gingold Subject: incorrect composite_type result for pointers with mode Date: Wed, 25 Jan 2012 10:15:29 +0100 Message-Id: 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, composite_type doesn't consider the pointer mode when creating a pointer. As a consequence: type char *p32 __attribute__((mode (SI)); type char *p32 __attribute__((mode (SI)); creates a 64-bit pointers (on ia64-hp-openvms and certainly some other configuration). This breaks some compiler builds (depending on the build options). As far as I know, this is not a regression, so it may not qualify for a stage 4 submission. Tristan. 2012-01-25 Tristan Gingold * c-typeck.c (composite_type): Keep mode for pointers. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index b696e5e..2e33763 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -394,7 +394,7 @@ composite_type (tree t1, tree t2) tree pointed_to_1 = TREE_TYPE (t1); tree pointed_to_2 = TREE_TYPE (t2); tree target = composite_type (pointed_to_1, pointed_to_2); - t1 = build_pointer_type (target); + t1 = build_pointer_type_for_mode (target, TYPE_MODE (t1), false); t1 = build_type_attribute_variant (t1, attributes); return qualify_type (t1, t2); }