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: Eric Botcazou <ebotcazou@adacore.com>, Jeff Law <law@redhat.com>,
	    Bernd Schmidt <bschmidt@redhat.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix up memset handling in DSE (PR rtl-optimization/69891)
Date: Fri, 26 Feb 2016 12:51:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1602261350150.31547@t29.fhfr.qr> (raw)
In-Reply-To: <20160226121041.GB3017@tucnak.redhat.com>

On Fri, 26 Feb 2016, Jakub Jelinek wrote:

> Hi!
> 
> As analyzed by Eric, DSE mishandles memset calls if it can't figure out what
> the arguments to memset exactly are (it handles only register arguments
> right now), or if the second or third arguments are not CONST_INTs.
> In that case we don't call record_store, because we don't know what to call
> it on; but we need to treat it as a wild store, which is handled by the
> clear_rhs_from_active_local_stores () function (which record_store also uses
> if it can't figure out what exactly is being overwritten).
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

Ok.

Thanks,
Richard.

> 2016-02-26  Jakub Jelinek  <jakub@redhat.com>
> 	    Eric Botcazou  <ebotcazou@adacore.com>
> 
> 	PR rtl-optimization/69891
> 	* dse.c (scan_insn): If we can't figure out memset arguments
> 	or they are non-constant, call clear_rhs_from_active_local_stores.
> 
> 	* gcc.target/i386/pr69891.c: New test.
> 
> --- gcc/dse.c.jj	2016-01-19 13:32:12.000000000 +0100
> +++ gcc/dse.c	2016-02-26 11:03:36.694206088 +0100
> @@ -2556,6 +2556,8 @@ scan_insn (bb_info_t bb_info, rtx_insn *
>  		      active_local_stores = insn_info;
>  		    }
>  		}
> +	      else
> +		clear_rhs_from_active_local_stores ();
>  	    }
>  	}
>        else if (SIBLING_CALL_P (insn) && reload_completed)
> --- gcc/testsuite/gcc.target/i386/pr69891.c.jj	2016-02-26 11:09:45.492079225 +0100
> +++ gcc/testsuite/gcc.target/i386/pr69891.c	2016-02-26 11:10:58.941058170 +0100
> @@ -0,0 +1,30 @@
> +/* PR rtl-optimization/69891 */
> +/* { dg-do run } */
> +/* { dg-options "-O -fno-tree-fre -mstringop-strategy=libcall -Wno-psabi" } */
> +/* { dg-additional-options "-mno-sse" { target ia32 } } */
> +
> +typedef unsigned short A;
> +typedef unsigned short B __attribute__ ((vector_size (32)));
> +typedef unsigned int C;
> +typedef unsigned int D __attribute__ ((vector_size (32)));
> +typedef unsigned long long E;
> +typedef unsigned long long F __attribute__ ((vector_size (32)));
> +
> +__attribute__((noinline, noclone)) unsigned
> +foo(D a, B b, D c, F d)
> +{
> +  b /= (B) {1, -c[0]} | 1;
> +  c[0] |= 7;
> +  a %= c | 1;
> +  c ^= c;
> +  return a[0] + b[15] + c[0] + d[3];
> +}
> +
> +int
> +main ()
> +{
> +  unsigned x = foo ((D) {}, (B) {}, (D) {}, (F) {});
> +  if (x != 0)
> +    __builtin_abort ();
> +  return 0;
> +}
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)

      reply	other threads:[~2016-02-26 12:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 12:10 Jakub Jelinek
2016-02-26 12:51 ` 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.1602261350150.31547@t29.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=bschmidt@redhat.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@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).