public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Create less TARGET_MEM_REFs
Date: Wed, 18 Jun 2014 10:31:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1406181221370.29270@zhemvz.fhfr.qr> (raw)
In-Reply-To: <20140618100403.GK31640@tucnak.redhat.com>

On Wed, 18 Jun 2014, Jakub Jelinek wrote:

> On Wed, Jun 18, 2014 at 11:56:01AM +0200, Richard Biener wrote:
> > 
> > I just figured that we create &TARGET_MEM_REF [base: a_4, offset: 0]
> > from within IVOPTs.  That pessimizes further passes unnecessarily.
> > 
> > Bootstrap and regtest running on x86_64-unknown-linux-gnu.
> 
> Isn't that against the comment above it?
>        ???  As IVOPTs does not follow restrictions to where the base
>        pointer may point to create a MEM_REF only if we know that
>        base is valid.
> Perhaps it is fine only if addr->offset is integer_zerop?

Oh .... yeah, I guess so.  Damn IVOPTs ... (though I wonder what's
the difference with MEM[&foo, -4B] then, which we don't catch
either).  That said, I'm not sure if it really fixes anything
not allowing MEM_REFs in all cases.

I've found a different workaround for the issue I was facing so
I'm dropping this patch instead.

Richard.

> > 2014-06-18  Richard Biener  <rguenther@suse.de>
> > 
> > 	* tree-ssa-address.c (create_mem_ref_raw): Use proper predicate
> > 	to catch all valid MEM_REF pointer operands.
> > 
> > Index: gcc/tree-ssa-address.c
> > ===================================================================
> > --- gcc/tree-ssa-address.c	(revision 211771)
> > +++ gcc/tree-ssa-address.c	(working copy)
> > @@ -393,7 +393,7 @@ create_mem_ref_raw (tree type, tree alia
> >       ???  As IVOPTs does not follow restrictions to where the base
> >       pointer may point to create a MEM_REF only if we know that
> >       base is valid.  */
> > -  if ((TREE_CODE (base) == ADDR_EXPR || TREE_CODE (base) == INTEGER_CST)
> > +  if (is_gimple_mem_ref_addr (base)
> >        && (!index2 || integer_zerop (index2))
> >        && (!addr->index || integer_zerop (addr->index)))
> >      return fold_build2 (MEM_REF, type, base, addr->offset);

      reply	other threads:[~2014-06-18 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18  9:58 Richard Biener
2014-06-18 10:04 ` Jakub Jelinek
2014-06-18 10:31   ` Richard Biener [this message]

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.LSU.2.11.1406181221370.29270@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).