From patchwork Thu Mar 15 13:02:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 146944 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 57378B6F9F for ; Fri, 16 Mar 2012 00:02:55 +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=1332421377; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:In-Reply-To:Message-ID:References:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=jQnxzxlJvHMfAbswmjWJJ/xv5Ww=; b=LuWsYXLM4um5RTI Yne1hGCCRCcQ6guBYP/Atv6uipcrimzkt4hT73XXFmABs1uDoyJH2Mcysem407s1 GmE8fspD9ViFxBglLR6oVjzPrGmWsbd+rLe49yvvxqjtT5pO0R9ydGqCE1uvzH6b KbzyL0wwJhSDXiyxJhvPejYMhQoE= 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:Date:From:To:Cc:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=lRD5DSKf1jaC00Ok2AYNWzukv87CXQSLruKU1yQQwLoLlffCaomN2/m5KElmOA nonXzWBXWjyZquDMOmMzxZqpE+FFhdGhjegR0wfdVqxm99kDYj3el0FfXa1fXEuD mZXERyNYo/GFhB2ocit+y+r1PvI+Taf1MAXMLxFLIS9+4=; Received: (qmail 25437 invoked by alias); 15 Mar 2012 13:02:51 -0000 Received: (qmail 25429 invoked by uid 22791); 15 Mar 2012 13:02:50 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Mar 2012 13:02:36 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 6C42F910A1; Thu, 15 Mar 2012 14:02:35 +0100 (CET) Date: Thu, 15 Mar 2012 14:02:35 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: "Joseph S. Myers" , ebotcazou@adacore.com Subject: Re: [PATCH] Change VECTOR_CST representation from TREE_LIST to TREE_VEC-like In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 On Thu, 15 Mar 2012, Richard Guenther wrote: > > This removes the use of TREE_LISTs for VECTOR_CSTs and instead employs > a similar way of storing elements as TREE_VECs. I copied the > macro interface bits of the CONSTRUCTOR accesses and did a 1:1 transform > at most places to not let refactoring errors creep in (well, where > possible). I'm not sure if it's worth omitting the explicit length > field in favor of using that of the type - at least we are getting > consistency (no implicit zero elements) here for free. > > Bootstrap and regtest on x86_64-unknown-linux-gnu running. I cannot > test sparc apart from compiling a cc1, which works. > > Ok for the c-common and sparc bits? Any other comments? Bootstrapped ok on x86_64-unknown-linux-gnu. Incremental patch to fix issues revealed by testing below. Richard. Index: gcc/tree.c =================================================================== --- gcc/tree.c.orig 2012-03-15 14:02:31.000000000 +0100 +++ gcc/tree.c 2012-03-15 13:51:27.000000000 +0100 @@ -1328,6 +1328,7 @@ build_vector_stat (tree type, tree *vals v = ggc_alloc_zone_cleared_tree_node_stat (&tree_zone, length PASS_MEM_STAT); TREE_SET_CODE (v, VECTOR_CST); + TREE_CONSTANT (v) = 1; TREE_TYPE (v) = type; /* Iterate through elements and check for overflow. */ Index: gcc/varasm.c =================================================================== --- gcc/varasm.c.orig 2012-03-15 14:02:31.000000000 +0100 +++ gcc/varasm.c 2012-03-15 13:59:37.000000000 +0100 @@ -4596,8 +4596,8 @@ output_constant (tree exp, unsigned HOST elt_size = GET_MODE_SIZE (inner); - thissize = 0; output_constant (VECTOR_CST_ELT (exp, 0), elt_size, align); + thissize = elt_size; for (i = 1; i < VECTOR_CST_NELTS (exp); ++i) { output_constant (VECTOR_CST_ELT (exp, i), elt_size, nalign);