public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix fallout of PR77399 fix
@ 2016-10-04  8:50 Richard Biener
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Biener @ 2016-10-04  8:50 UTC (permalink / raw)
  To: gcc-patches


Andreas noticed I forgot to check if the target can fix/float a vector.

Bootstrap / regtest pending on x86_64-unknown-linux-gnu.  Verified
the fix with a cross to ia64-linux.

Richard.

2016-10-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77399
	* tree-ssa-forwprop.c (simplify_vector_constructor): Properly
	verify the target can convert.

	* gcc.dg/tree-ssa/forwprop-35.c: Adjust.

Index: gcc/tree-ssa-forwprop.c
===================================================================
--- gcc/tree-ssa-forwprop.c	(revision 240739)
+++ gcc/tree-ssa-forwprop.c	(working copy)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.
 #include "builtins.h"
 #include "tree-cfgcleanup.h"
 #include "cfganal.h"
+#include "optabs-tree.h"
 
 /* This pass propagates the RHS of assignment statements into use
    sites of the LHS of the assignment.  It's basically a specialized
@@ -2037,6 +2038,13 @@ simplify_vector_constructor (gimple_stmt
 	  != TYPE_VECTOR_SUBPARTS (TREE_TYPE (orig))))
     return false;
 
+  tree tem;
+  if (conv_code != ERROR_MARK
+      && (! supportable_convert_operation (conv_code, type, TREE_TYPE (orig),
+					   &tem, &conv_code)
+	  || conv_code == CALL_EXPR))
+    return false;
+
   if (maybe_ident)
     {
       if (conv_code == ERROR_MARK)
Index: gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c	(revision 240739)
+++ gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c	(working copy)
@@ -14,5 +14,5 @@ v4sf vec_cast_perm(v4si f)
   return (v4sf){f[1], f[1], f[2], f[3]};
 }
 
-/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" } } */
-/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" } } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" { target x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" { target x86_64-*-* } } } */

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

* Re: [PATCH] Fix fallout of PR77399 fix
  2016-10-04 10:25     ` Richard Biener
@ 2016-10-04 10:56       ` Uros Bizjak
  0 siblings, 0 replies; 6+ messages in thread
From: Uros Bizjak @ 2016-10-04 10:56 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Tue, Oct 4, 2016 at 12:25 PM, Richard Biener <rguenther@suse.de> wrote:
> On Tue, 4 Oct 2016, Uros Bizjak wrote:
>
>> On Tue, Oct 4, 2016 at 12:00 PM, Richard Biener <rguenther@suse.de> wrote:
>>
>> >> x86 targets should always be in pair, so "target i?86-*-* x86_64-*-*",
>> >> with an optional ia32 target addition when the test is valid for 32
>> >> bit targets only, or { ! ia32 } addition when test is valid for 64-bit
>> >> targets only.
>> >
>> > I need SSE2 support but didn't want to adjust dg-options with another
>> > { target } ... so with default ISA this is valid for x86_64 only
>> > AFAIK?  It might be ok for i?86-*-* with -m64 thus that is your
>> > { i?86-*-* x86_64-*-* } && { ! ia32 } then?  But x86_64-*-* -m32
>> > is ok ...
>> >
>> > I'll try a
>> >
>> > /* { dg-options "-O -fdump-tree-cddce1 -msse2" { target { i?86-*-*
>> > x86_64-*-* } } } */
>> >
>> > then.
>>
>> You need sse2_runtime effective target. Please see e.g.
>> gcc.dg/pr37544.c (or gcc.dg/pr36584.c for 32-bit only target) on how
>> it should be used
>
> It's a dg-do compile testcase only so I think that's not needed.

In this case, you are right.

BTW: You can use dg-additional-options in your patch.

Uros.

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

* Re: [PATCH] Fix fallout of PR77399 fix
  2016-10-04 10:06   ` Uros Bizjak
@ 2016-10-04 10:25     ` Richard Biener
  2016-10-04 10:56       ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2016-10-04 10:25 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Tue, 4 Oct 2016, Uros Bizjak wrote:

> On Tue, Oct 4, 2016 at 12:00 PM, Richard Biener <rguenther@suse.de> wrote:
> 
> >> x86 targets should always be in pair, so "target i?86-*-* x86_64-*-*",
> >> with an optional ia32 target addition when the test is valid for 32
> >> bit targets only, or { ! ia32 } addition when test is valid for 64-bit
> >> targets only.
> >
> > I need SSE2 support but didn't want to adjust dg-options with another
> > { target } ... so with default ISA this is valid for x86_64 only
> > AFAIK?  It might be ok for i?86-*-* with -m64 thus that is your
> > { i?86-*-* x86_64-*-* } && { ! ia32 } then?  But x86_64-*-* -m32
> > is ok ...
> >
> > I'll try a
> >
> > /* { dg-options "-O -fdump-tree-cddce1 -msse2" { target { i?86-*-*
> > x86_64-*-* } } } */
> >
> > then.
> 
> You need sse2_runtime effective target. Please see e.g.
> gcc.dg/pr37544.c (or gcc.dg/pr36584.c for 32-bit only target) on how
> it should be used

It's a dg-do compile testcase only so I think that's not needed.

Richard.

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

* Re: [PATCH] Fix fallout of PR77399 fix
  2016-10-04 10:00 ` Richard Biener
@ 2016-10-04 10:06   ` Uros Bizjak
  2016-10-04 10:25     ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2016-10-04 10:06 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Tue, Oct 4, 2016 at 12:00 PM, Richard Biener <rguenther@suse.de> wrote:

>> x86 targets should always be in pair, so "target i?86-*-* x86_64-*-*",
>> with an optional ia32 target addition when the test is valid for 32
>> bit targets only, or { ! ia32 } addition when test is valid for 64-bit
>> targets only.
>
> I need SSE2 support but didn't want to adjust dg-options with another
> { target } ... so with default ISA this is valid for x86_64 only
> AFAIK?  It might be ok for i?86-*-* with -m64 thus that is your
> { i?86-*-* x86_64-*-* } && { ! ia32 } then?  But x86_64-*-* -m32
> is ok ...
>
> I'll try a
>
> /* { dg-options "-O -fdump-tree-cddce1 -msse2" { target { i?86-*-*
> x86_64-*-* } } } */
>
> then.

You need sse2_runtime effective target. Please see e.g.
gcc.dg/pr37544.c (or gcc.dg/pr36584.c for 32-bit only target) on how
it should be used

Uros.

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

* Re: [PATCH] Fix fallout of PR77399 fix
  2016-10-04  9:54 Uros Bizjak
@ 2016-10-04 10:00 ` Richard Biener
  2016-10-04 10:06   ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2016-10-04 10:00 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On Tue, 4 Oct 2016, Uros Bizjak wrote:

> Hello!
> 
> > Andreas noticed I forgot to check if the target can fix/float a vector.
> >
> > Bootstrap / regtest pending on x86_64-unknown-linux-gnu.  Verified
> > the fix with a cross to ia64-linux.
> >
> > Richard.
> >
> > 2016-10-04  Richard Biener  <rguenther@suse.de>
> >
> > PR tree-optimization/77399
> > * tree-ssa-forwprop.c (simplify_vector_constructor): Properly
> > verify the target can convert.
> >
> > * gcc.dg/tree-ssa/forwprop-35.c: Adjust.
> 
> -/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" } } */
> -/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" } } */
> +/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" {
> target x86_64-*-* } } } */
> +/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" {
> target x86_64-*-* } } } */
> 
> x86 targets should always be in pair, so "target i?86-*-* x86_64-*-*",
> with an optional ia32 target addition when the test is valid for 32
> bit targets only, or { ! ia32 } addition when test is valid for 64-bit
> targets only.

I need SSE2 support but didn't want to adjust dg-options with another
{ target } ... so with default ISA this is valid for x86_64 only
AFAIK?  It might be ok for i?86-*-* with -m64 thus that is your
{ i?86-*-* x86_64-*-* } && { ! ia32 } then?  But x86_64-*-* -m32
is ok ...

I'll try a

/* { dg-options "-O -fdump-tree-cddce1 -msse2" { target { i?86-*-* 
x86_64-*-* } } } */

then.

Richard.

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

* Re: [PATCH] Fix fallout of PR77399 fix
@ 2016-10-04  9:54 Uros Bizjak
  2016-10-04 10:00 ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2016-10-04  9:54 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Biener

Hello!

> Andreas noticed I forgot to check if the target can fix/float a vector.
>
> Bootstrap / regtest pending on x86_64-unknown-linux-gnu.  Verified
> the fix with a cross to ia64-linux.
>
> Richard.
>
> 2016-10-04  Richard Biener  <rguenther@suse.de>
>
> PR tree-optimization/77399
> * tree-ssa-forwprop.c (simplify_vector_constructor): Properly
> verify the target can convert.
>
> * gcc.dg/tree-ssa/forwprop-35.c: Adjust.

-/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" } } */
-/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" } } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" {
target x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" {
target x86_64-*-* } } } */

x86 targets should always be in pair, so "target i?86-*-* x86_64-*-*",
with an optional ia32 target addition when the test is valid for 32
bit targets only, or { ! ia32 } addition when test is valid for 64-bit
targets only.

Uros.

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

end of thread, other threads:[~2016-10-04 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04  8:50 [PATCH] Fix fallout of PR77399 fix Richard Biener
2016-10-04  9:54 Uros Bizjak
2016-10-04 10:00 ` Richard Biener
2016-10-04 10:06   ` Uros Bizjak
2016-10-04 10:25     ` Richard Biener
2016-10-04 10:56       ` Uros Bizjak

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