public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [Ada] constrained discriminated records and SRA
Date: Thu, 22 Oct 2009 10:51:00 -0000	[thread overview]
Message-ID: <20091022104249.GA11795@virgil.suse.cz> (raw)
In-Reply-To: <200910160858.13450.ebotcazou@adacore.com>

Hi Eric,

On Fri, Oct 16, 2009 at 08:58:13AM +0200, Eric Botcazou wrote:
> > Martin, this should make it possible to get rid of
> >
> > 	  /* Some ADA records are half-unions, treat all of them the same.  */
> > 	  for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
> >
> > and the associated special handling in the new SRA pass.
> 

sorry for replying so late.  The reason for this comment was that
originally I handled unions and records differently, recursing only
for unions and picking the right fields and looping for records.  This
did not work because of overlapping fields in records that Ada
produced.  I am happy to learn that is not happening any more,
however, I am not sure that splitting the code paths again now is
worth the effort as the overhead is not probably going to be that big
and shared code paths are also good from the maintenance point of
view.

So my suggestion would be to remove the whole comment, or replace it
with something saying that if looking up stuff in records is deemed
too slow in future, we should be able to simplify it now.

Thanks,

Martin

> I've installed the attached patchlet.
> 
> 
> 2009-10-16  Eric Botcazou  <ebotcazou@adacore.com>
> 
> 	* tree-sra.c (build_ref_for_offset_1): Update comment.
> 
> 
> -- 
> Eric Botcazou

> Index: tree-sra.c
> ===================================================================
> --- tree-sra.c	(revision 152797)
> +++ tree-sra.c	(working copy)
> @@ -1231,7 +1231,8 @@ build_ref_for_offset_1 (tree *res, tree 
>  	case UNION_TYPE:
>  	case QUAL_UNION_TYPE:
>  	case RECORD_TYPE:
> -	  /* Some ADA records are half-unions, treat all of them the same.  */
> +	  /* ??? Some records used to be half-unions in Ada so the code treats
> +	     the 3 container types the same.  This has been fixed in Ada.  */
>  	  for (fld = TYPE_FIELDS (type); fld; fld = TREE_CHAIN (fld))
>  	    {
>  	      HOST_WIDE_INT pos, size;

  reply	other threads:[~2009-10-22 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29 11:31 Eric Botcazou
2009-10-16  7:25 ` Eric Botcazou
2009-10-22 10:51   ` Martin Jambor [this message]
2009-10-22 11:41     ` Eric Botcazou
2009-10-30 14:49       ` Martin Jambor

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=20091022104249.GA11795@virgil.suse.cz \
    --to=mjambor@suse.cz \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).