public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR68248
@ 2015-11-09 14:43 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-11-09 14:43 UTC (permalink / raw)
  To: gcc-patches


Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

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

	PR tree-optimization/68248
	* tree-vect-generic.c (expand_vector_operations_1): Handle
	scalar rhs2.

	* gcc.dg/torture/pr68248.c: New testcase.

Index: gcc/tree-vect-generic.c
===================================================================
*** gcc/tree-vect-generic.c	(revision 230003)
--- gcc/tree-vect-generic.c	(working copy)
*************** expand_vector_operations_1 (gimple_stmt_
*** 1527,1532 ****
--- 1528,1535 ----
    tree srhs1, srhs2 = NULL_TREE;
    if ((srhs1 = ssa_uniform_vector_p (rhs1)) != NULL_TREE
        && (rhs2 == NULL_TREE
+ 	  || (! VECTOR_TYPE_P (TREE_TYPE (rhs2))
+ 	      && (srhs2 = rhs2))
  	  || (srhs2 = ssa_uniform_vector_p (rhs2)) != NULL_TREE)
        /* As we query direct optabs restrict to non-convert operations.  */
        && TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (TREE_TYPE (srhs1)))
Index: gcc/testsuite/gcc.dg/torture/pr68248.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr68248.c	(revision 0)
--- gcc/testsuite/gcc.dg/torture/pr68248.c	(working copy)
***************
*** 0 ****
--- 1,20 ----
+ /* { dg-do compile } */
+ 
+ int a, b, c, d;
+ 
+ int
+ fn1 (int p1)
+ {
+   return a > 0 ? p1 : p1 >> a;
+ }
+ 
+ void
+ fn2 ()
+ {
+   char e;
+   for (; c; c++)
+     {
+       e = fn1 (!d ^ 2);
+       b ^= e;
+     }
+ }

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

only message in thread, other threads:[~2015-11-09 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09 14:43 [PATCH] Fix PR68248 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).