public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix PR tree-optimization/50727
@ 2011-10-16 18:19 Ira Rosen
  0 siblings, 0 replies; only message in thread
From: Ira Rosen @ 2011-10-16 18:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: Patch Tracking

Hi,

This patch fixes another occurrence of the same bug as in PR 50635.

Bootstrapped and tested on powerpc64-suse-linux.
Committed.

Ira

ChangeLog:

        PR tree-optimization/50727
        * tree-vect-patterns.c (vect_operation_fits_smaller_type): Add
        DEF_STMT to the list of statements to be replaced by the
        pattern statements.

testsuite/ChangeLog:

        PR tree-optimization/50727
        * gcc.dg/vect/pr50727.c: New test.



Index: testsuite/gcc.dg/vect/pr50727.c
===================================================================
--- testsuite/gcc.dg/vect/pr50727.c     (revision 0)
+++ testsuite/gcc.dg/vect/pr50727.c     (revision 0)
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+typedef unsigned long uint32_t;
+void
+f0a (uint32_t * __restrict__ result, uint32_t * arg2,
+     uint8_t * __restrict__ arg4)
+{
+  int idx;
+  for (idx = 0; idx < 429; idx += 1)
+    {
+      uint32_t temp_9;
+      uint32_t temp_11;
+      temp_9 = ((-19 | arg4[idx]) >> arg2[idx]);
+      temp_11 = (((-19 ^ arg4[idx]) & arg2[idx]) ^ temp_9);
+      result[idx] = temp_11;
+    }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
Index: tree-vect-patterns.c
===================================================================
--- tree-vect-patterns.c        (revision 180054)
+++ tree-vect-patterns.c        (working copy)
@@ -1001,6 +1001,7 @@ vect_operation_fits_smaller_type (gimple stmt, tre
                   || TREE_TYPE (gimple_assign_lhs (new_stmt)) != interm_type)
                 return false;

+             VEC_safe_push (gimple, heap, *stmts, def_stmt);
               oprnd = gimple_assign_lhs (new_stmt);
             }
           else

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-16 13:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-16 18:19 [patch] Fix PR tree-optimization/50727 Ira Rosen

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