public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: "Joseph S. Myers" <joseph@codesourcery.com>,	ebotcazou@adacore.com
Subject: Re: [PATCH] Change VECTOR_CST representation from TREE_LIST to TREE_VEC-like
Date: Thu, 15 Mar 2012 13:02:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1203151400390.27160@zhemvz.fhfr.qr> (raw)
In-Reply-To: <alpine.LNX.2.00.1203151306160.27160@zhemvz.fhfr.qr>

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);

  reply	other threads:[~2012-03-15 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-15 12:20 Richard Guenther
2012-03-15 13:02 ` Richard Guenther [this message]
2012-03-15 14:32 ` Eric Botcazou
2012-03-15 17:21 ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1203151400390.27160@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).