public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR66823
@ 2015-07-09 12:59 Richard Biener
  2015-07-10  7:51 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2015-07-09 12:59 UTC (permalink / raw)
  To: gcc-patches


The following fixes a stupid bug with -ftree-loop-if-convert-stores.
We were treating all but the same base as candidate to determine
whether a ref was accessed unconditionally ...

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Richard.

2015-07-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66823
	* tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
	inverted predicate.

Index: gcc/tree-if-conv.c
===================================================================
--- gcc/tree-if-conv.c	(revision 225610)
+++ gcc/tree-if-conv.c	(working copy)
@@ -642,7 +642,7 @@ memrefs_read_or_written_unconditionally
                    || TREE_CODE (ref_base_b) == REALPART_EXPR)
               ref_base_b = TREE_OPERAND (ref_base_b, 0);
 
-  	    if (!operand_equal_p (ref_base_a, ref_base_b, 0))
+  	    if (operand_equal_p (ref_base_a, ref_base_b, 0))
 	      {
 	        tree cb = bb_predicate (gimple_bb (DR_STMT (b)));
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix PR66823
  2015-07-09 12:59 [PATCH] Fix PR66823 Richard Biener
@ 2015-07-10  7:51 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-07-10  7:51 UTC (permalink / raw)
  To: gcc-patches

On Thu, 9 Jul 2015, Richard Biener wrote:

> 
> The following fixes a stupid bug with -ftree-loop-if-convert-stores.
> We were treating all but the same base as candidate to determine
> whether a ref was accessed unconditionally ...
> 
> Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Applied as follows, with gcc.dg/vect/pr61194.c adjusted which
now FAILs because in

  int i;
  for (i=0; i<1024; ++i)
    z[i] = ((x[i]>0) & (w[i]<0)) ? z[i] : y[i];

while z[i] is correctly identified as not trapping because
it is written to unconditionally, y[i] is not (but was
previously as any of the unconditional accesses to
x[i], w[i] or z[i] counted as that).

Applied to trunk.

2015-07-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66823
	* tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
	inverted predicate.

	* gcc.dg/vect/pr61194.c: Remove -ftree-loop-if-convert-stores
	which should not be necessary.  XFAIL.

Index: gcc/tree-if-conv.c
===================================================================
--- gcc/tree-if-conv.c	(revision 225610)
+++ gcc/tree-if-conv.c	(working copy)
@@ -642,7 +642,7 @@ memrefs_read_or_written_unconditionally
                    || TREE_CODE (ref_base_b) == REALPART_EXPR)
               ref_base_b = TREE_OPERAND (ref_base_b, 0);
 
-  	    if (!operand_equal_p (ref_base_a, ref_base_b, 0))
+  	    if (operand_equal_p (ref_base_a, ref_base_b, 0))
 	      {
 	        tree cb = bb_predicate (gimple_bb (DR_STMT (b)));
 
Index: gcc/testsuite/gcc.dg/vect/pr61194.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/pr61194.c	(revision 225610)
+++ gcc/testsuite/gcc.dg/vect/pr61194.c	(working copy)
@@ -1,5 +1,4 @@
 /* { dg-require-effective-target vect_cond_mixed } */
-/* { dg-additional-options "-ftree-loop-if-convert-stores" } */
 
 #include "tree-vect.h"
 
@@ -39,4 +38,4 @@ int main()
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-10  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 12:59 [PATCH] Fix PR66823 Richard Biener
2015-07-10  7:51 ` Richard Biener

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