public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
@ 2015-02-25 10:20 Kai Tietz
  2015-02-25 11:04 ` Richard Biener
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Tietz @ 2015-02-25 10:20 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jakub Jelinek

Hello,

ChangeLog

2015-02-25  Kai Tietz  <ktietz@redhat.com>

    PR tree-optimization/61917
    * tree-vect-loop.c (vectorizable_reduction): Allow
    vect_internal_def without reduction to exit graceful.

ChagneLog testsuite/

2015-02-25  Kai Tietz  <ktietz@redhat.com>

    PR tree-optimization/61917
    * gcc.dg/vect/vect-pr61917.c: New file.

Tested for x86_64-unkown-linux.  Ok for apply?
Regards,
Kai

Index: tree-vect-loop.c
===================================================================
--- tree-vect-loop.c    (Revision 220958)
+++ tree-vect-loop.c    (Arbeitskopie)
@@ -4990,7 +4990,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
       /* For pattern recognized stmts, orig_stmt might be a reduction,
      but some helper statements for the pattern might not, or
      might be COND_EXPRs with reduction uses in the condition.  */
-      gcc_assert (orig_stmt);
+      gcc_assert (orig_stmt || dt == vect_internal_def);
       return false;
     }
   if (!found_nested_cycle_def)
Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
===================================================================
--- /dev/null
+++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+int a, b, c, d;
+
+int
+fn1 ()
+{
+  for (; c; c++)
+    for (b = 0; b < 2; b++)
+      d = a - d;
+  return d;
+}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 10:20 [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913 Kai Tietz
@ 2015-02-25 11:04 ` Richard Biener
  2015-02-25 11:16   ` Kai Tietz
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Biener @ 2015-02-25 11:04 UTC (permalink / raw)
  To: Kai Tietz; +Cc: GCC Patches, Jakub Jelinek

On Wed, Feb 25, 2015 at 11:06 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> ChangeLog
>
> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>
>     PR tree-optimization/61917
>     * tree-vect-loop.c (vectorizable_reduction): Allow
>     vect_internal_def without reduction to exit graceful.
>
> ChagneLog testsuite/
>
> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>
>     PR tree-optimization/61917
>     * gcc.dg/vect/vect-pr61917.c: New file.
>
> Tested for x86_64-unkown-linux.  Ok for apply?

It doesn't make much sense to fail here as said in the comment
because of patterns if the actual case isn't a pattern.  Also
the patch causing this made vect_external_def possible, so
why does this affect vect_internal_def here?

It may paper over the issue - but clearly the fix is bogus.

Richard.

> Regards,
> Kai
>
> Index: tree-vect-loop.c
> ===================================================================
> --- tree-vect-loop.c    (Revision 220958)
> +++ tree-vect-loop.c    (Arbeitskopie)
> @@ -4990,7 +4990,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>        /* For pattern recognized stmts, orig_stmt might be a reduction,
>       but some helper statements for the pattern might not, or
>       might be COND_EXPRs with reduction uses in the condition.  */
> -      gcc_assert (orig_stmt);
> +      gcc_assert (orig_stmt || dt == vect_internal_def);
>        return false;
>      }
>    if (!found_nested_cycle_def)
> Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
> ===================================================================
> --- /dev/null
> +++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
> @@ -0,0 +1,13 @@
> +/* { dg-do compile } */
> +/* { dg-additional-options "-O3" } */
> +
> +int a, b, c, d;
> +
> +int
> +fn1 ()
> +{
> +  for (; c; c++)
> +    for (b = 0; b < 2; b++)
> +      d = a - d;
> +  return d;
> +}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 11:04 ` Richard Biener
@ 2015-02-25 11:16   ` Kai Tietz
  2015-02-25 11:50     ` Richard Biener
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Tietz @ 2015-02-25 11:16 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jakub Jelinek

2015-02-25 11:57 GMT+01:00 Richard Biener <richard.guenther@gmail.com>:
> On Wed, Feb 25, 2015 at 11:06 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> Hello,
>>
>> ChangeLog
>>
>> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>>
>>     PR tree-optimization/61917
>>     * tree-vect-loop.c (vectorizable_reduction): Allow
>>     vect_internal_def without reduction to exit graceful.
>>
>> ChagneLog testsuite/
>>
>> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>>
>>     PR tree-optimization/61917
>>     * gcc.dg/vect/vect-pr61917.c: New file.
>>
>> Tested for x86_64-unkown-linux.  Ok for apply?
>
> It doesn't make much sense to fail here as said in the comment
> because of patterns if the actual case isn't a pattern.  Also
> the patch causing this made vect_external_def possible, so
> why does this affect vect_internal_def here?
>
> It may paper over the issue - but clearly the fix is bogus.

Well, actually I don't see any good reason for failing here at all,
but I assumed that author wanted to get by it some missed cases.
AFAIU the code we actually don't need/want to assert here either on
internal (where it is pretty likely no pattern present), and also on
externals, too.
I would be fine to remove this assert here completely, but I thought
it might be of interest to see that orig_stmt isn't NULL for nested
case

Kai

> Richard.
>
>> Regards,
>> Kai
>>
>> Index: tree-vect-loop.c
>> ===================================================================
>> --- tree-vect-loop.c    (Revision 220958)
>> +++ tree-vect-loop.c    (Arbeitskopie)
>> @@ -4990,7 +4990,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>>        /* For pattern recognized stmts, orig_stmt might be a reduction,
>>       but some helper statements for the pattern might not, or
>>       might be COND_EXPRs with reduction uses in the condition.  */
>> -      gcc_assert (orig_stmt);
>> +      gcc_assert (orig_stmt || dt == vect_internal_def);
>>        return false;
>>      }
>>    if (!found_nested_cycle_def)
>> Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
>> ===================================================================
>> --- /dev/null
>> +++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
>> @@ -0,0 +1,13 @@
>> +/* { dg-do compile } */
>> +/* { dg-additional-options "-O3" } */
>> +
>> +int a, b, c, d;
>> +
>> +int
>> +fn1 ()
>> +{
>> +  for (; c; c++)
>> +    for (b = 0; b < 2; b++)
>> +      d = a - d;
>> +  return d;
>> +}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 11:16   ` Kai Tietz
@ 2015-02-25 11:50     ` Richard Biener
  2015-02-25 12:38       ` Kai Tietz
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Biener @ 2015-02-25 11:50 UTC (permalink / raw)
  To: Kai Tietz; +Cc: GCC Patches, Jakub Jelinek

On Wed, Feb 25, 2015 at 12:05 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2015-02-25 11:57 GMT+01:00 Richard Biener <richard.guenther@gmail.com>:
>> On Wed, Feb 25, 2015 at 11:06 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>>> Hello,
>>>
>>> ChangeLog
>>>
>>> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>>>
>>>     PR tree-optimization/61917
>>>     * tree-vect-loop.c (vectorizable_reduction): Allow
>>>     vect_internal_def without reduction to exit graceful.
>>>
>>> ChagneLog testsuite/
>>>
>>> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>>>
>>>     PR tree-optimization/61917
>>>     * gcc.dg/vect/vect-pr61917.c: New file.
>>>
>>> Tested for x86_64-unkown-linux.  Ok for apply?
>>
>> It doesn't make much sense to fail here as said in the comment
>> because of patterns if the actual case isn't a pattern.  Also
>> the patch causing this made vect_external_def possible, so
>> why does this affect vect_internal_def here?
>>
>> It may paper over the issue - but clearly the fix is bogus.
>
> Well, actually I don't see any good reason for failing here at all,
> but I assumed that author wanted to get by it some missed cases.
> AFAIU the code we actually don't need/want to assert here either on
> internal (where it is pretty likely no pattern present), and also on
> externals, too.
> I would be fine to remove this assert here completely, but I thought
> it might be of interest to see that orig_stmt isn't NULL for nested
> case

I agree that the code is overusing asserts but the path you bail out
on is bogus.  Fact is that we somehow detected a reduction here
(via special-casing of minus I guess) but fail to properly handle it
later.  In fact we assert that we end up with a PHI node in the definition
but would ICE there as well.  Thus a better patch would be

Index: gcc/tree-vect-loop.c
===================================================================
--- gcc/tree-vect-loop.c        (revision 220958)
+++ gcc/tree-vect-loop.c        (working copy)
@@ -4981,6 +4981,13 @@ vectorizable_reduction (gimple stmt, gim
   if (!vectype_in)
     vectype_in = tem;
   gcc_assert (is_simple_use);
+
+  /* If the defining stmt isn't a PHI node then this isn't a reduction.  */
+  if (!found_nested_cycle_def)
+    reduc_def_stmt = def_stmt;
+  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
+    return false;
+
   if (!(dt == vect_reduction_def
        || dt == vect_nested_cycle
        || ((dt == vect_internal_def || dt == vect_external_def
@@ -4993,10 +5000,7 @@ vectorizable_reduction (gimple stmt, gim
       gcc_assert (orig_stmt);
       return false;
     }
-  if (!found_nested_cycle_def)
-    reduc_def_stmt = def_stmt;

-  gcc_assert (gimple_code (reduc_def_stmt) == GIMPLE_PHI);
   if (orig_stmt)
     gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo,
                                                        reduc_def_stmt,

Richard.

> Kai
>
>> Richard.
>>
>>> Regards,
>>> Kai
>>>
>>> Index: tree-vect-loop.c
>>> ===================================================================
>>> --- tree-vect-loop.c    (Revision 220958)
>>> +++ tree-vect-loop.c    (Arbeitskopie)
>>> @@ -4990,7 +4990,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>>>        /* For pattern recognized stmts, orig_stmt might be a reduction,
>>>       but some helper statements for the pattern might not, or
>>>       might be COND_EXPRs with reduction uses in the condition.  */
>>> -      gcc_assert (orig_stmt);
>>> +      gcc_assert (orig_stmt || dt == vect_internal_def);
>>>        return false;
>>>      }
>>>    if (!found_nested_cycle_def)
>>> Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
>>> ===================================================================
>>> --- /dev/null
>>> +++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
>>> @@ -0,0 +1,13 @@
>>> +/* { dg-do compile } */
>>> +/* { dg-additional-options "-O3" } */
>>> +
>>> +int a, b, c, d;
>>> +
>>> +int
>>> +fn1 ()
>>> +{
>>> +  for (; c; c++)
>>> +    for (b = 0; b < 2; b++)
>>> +      d = a - d;
>>> +  return d;
>>> +}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 11:50     ` Richard Biener
@ 2015-02-25 12:38       ` Kai Tietz
  2015-02-25 13:26         ` Kai Tietz
  0 siblings, 1 reply; 11+ messages in thread
From: Kai Tietz @ 2015-02-25 12:38 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jakub Jelinek

2015-02-25 12:35 GMT+01:00 Richard Biener <richard.guenther@gmail.com>:
> On Wed, Feb 25, 2015 at 12:05 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> 2015-02-25 11:57 GMT+01:00 Richard Biener <richard.guenther@gmail.com>:
>>> On Wed, Feb 25, 2015 at 11:06 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>>>> Hello,
>>>>
>>>> ChangeLog
>>>>
>>>> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>>>>
>>>>     PR tree-optimization/61917
>>>>     * tree-vect-loop.c (vectorizable_reduction): Allow
>>>>     vect_internal_def without reduction to exit graceful.
>>>>
>>>> ChagneLog testsuite/
>>>>
>>>> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>>>>
>>>>     PR tree-optimization/61917
>>>>     * gcc.dg/vect/vect-pr61917.c: New file.
>>>>
>>>> Tested for x86_64-unkown-linux.  Ok for apply?
>>>
>>> It doesn't make much sense to fail here as said in the comment
>>> because of patterns if the actual case isn't a pattern.  Also
>>> the patch causing this made vect_external_def possible, so
>>> why does this affect vect_internal_def here?
>>>
>>> It may paper over the issue - but clearly the fix is bogus.
>>
>> Well, actually I don't see any good reason for failing here at all,
>> but I assumed that author wanted to get by it some missed cases.
>> AFAIU the code we actually don't need/want to assert here either on
>> internal (where it is pretty likely no pattern present), and also on
>> externals, too.
>> I would be fine to remove this assert here completely, but I thought
>> it might be of interest to see that orig_stmt isn't NULL for nested
>> case
>
> I agree that the code is overusing asserts but the path you bail out
> on is bogus.  Fact is that we somehow detected a reduction here
> (via special-casing of minus I guess) but fail to properly handle it
> later.  In fact we assert that we end up with a PHI node in the definition
> but would ICE there as well.  Thus a better patch would be
>
> Index: gcc/tree-vect-loop.c
> ===================================================================
> --- gcc/tree-vect-loop.c        (revision 220958)
> +++ gcc/tree-vect-loop.c        (working copy)
> @@ -4981,6 +4981,13 @@ vectorizable_reduction (gimple stmt, gim
>    if (!vectype_in)
>      vectype_in = tem;
>    gcc_assert (is_simple_use);
> +
> +  /* If the defining stmt isn't a PHI node then this isn't a reduction.  */
> +  if (!found_nested_cycle_def)
> +    reduc_def_stmt = def_stmt;
> +  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
> +    return false;
> +
>    if (!(dt == vect_reduction_def
>         || dt == vect_nested_cycle
>         || ((dt == vect_internal_def || dt == vect_external_def
> @@ -4993,10 +5000,7 @@ vectorizable_reduction (gimple stmt, gim
>        gcc_assert (orig_stmt);
>        return false;
>      }
> -  if (!found_nested_cycle_def)
> -    reduc_def_stmt = def_stmt;
>
> -  gcc_assert (gimple_code (reduc_def_stmt) == GIMPLE_PHI);
>    if (orig_stmt)
>      gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo,
>                                                         reduc_def_stmt,
>
> Richard.

Yes, your version is better for reader and shows the intention better.
I will give it a test.

Kai

>>> Richard.
>>>
>>>> Regards,
>>>> Kai
>>>>
>>>> Index: tree-vect-loop.c
>>>> ===================================================================
>>>> --- tree-vect-loop.c    (Revision 220958)
>>>> +++ tree-vect-loop.c    (Arbeitskopie)
>>>> @@ -4990,7 +4990,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>>>>        /* For pattern recognized stmts, orig_stmt might be a reduction,
>>>>       but some helper statements for the pattern might not, or
>>>>       might be COND_EXPRs with reduction uses in the condition.  */
>>>> -      gcc_assert (orig_stmt);
>>>> +      gcc_assert (orig_stmt || dt == vect_internal_def);
>>>>        return false;
>>>>      }
>>>>    if (!found_nested_cycle_def)
>>>> Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
>>>> ===================================================================
>>>> --- /dev/null
>>>> +++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
>>>> @@ -0,0 +1,13 @@
>>>> +/* { dg-do compile } */
>>>> +/* { dg-additional-options "-O3" } */
>>>> +
>>>> +int a, b, c, d;
>>>> +
>>>> +int
>>>> +fn1 ()
>>>> +{
>>>> +  for (; c; c++)
>>>> +    for (b = 0; b < 2; b++)
>>>> +      d = a - d;
>>>> +  return d;
>>>> +}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 12:38       ` Kai Tietz
@ 2015-02-25 13:26         ` Kai Tietz
  2015-02-25 13:33           ` Richard Biener
  2015-02-25 17:01           ` H.J. Lu
  0 siblings, 2 replies; 11+ messages in thread
From: Kai Tietz @ 2015-02-25 13:26 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Patches, Jakub Jelinek

Hello,

So, I did full regression-test for following patch:

ChangeLog

2015-02-25  Richard Biener  <rguenther@suse.de>
    Kai Tietz  <ktietz@redhat.com>

    PR tree-optimization/61917
    * tree-vect-loop.c (vectorizable_reduction): Allow
    vect_internal_def without reduction to exit graceful.

ChagneLog testsuite/

2015-02-25  Kai Tietz  <ktietz@redhat.com>

    PR tree-optimization/61917
    * gcc.dg/vect/vect-pr61917.c: New file.

Tested for x86_64-unkown-linux.  Ok for apply?

Regards,
Kai

Index: tree-vect-loop.c
===================================================================
--- tree-vect-loop.c    (Revision 220958)
+++ tree-vect-loop.c    (Arbeitskopie)
@@ -4981,6 +4981,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
   if (!vectype_in)
     vectype_in = tem;
   gcc_assert (is_simple_use);
+  if (!found_nested_cycle_def)
+    reduc_def_stmt = def_stmt;
+
+  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
+    return false;
+
   if (!(dt == vect_reduction_def
     || dt == vect_nested_cycle
     || ((dt == vect_internal_def || dt == vect_external_def
@@ -4993,10 +4999,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
       gcc_assert (orig_stmt);
       return false;
     }
-  if (!found_nested_cycle_def)
-    reduc_def_stmt = def_stmt;

-  gcc_assert (gimple_code (reduc_def_stmt) == GIMPLE_PHI);
   if (orig_stmt)
     gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo,
                                                        reduc_def_stmt,
Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
===================================================================
--- /dev/null
+++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+int a, b, c, d;
+
+int
+fn1 ()
+{
+  for (; c; c++)
+    for (b = 0; b < 2; b++)
+      d = a - d;
+  return d;
+}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 13:26         ` Kai Tietz
@ 2015-02-25 13:33           ` Richard Biener
  2015-02-25 17:01           ` H.J. Lu
  1 sibling, 0 replies; 11+ messages in thread
From: Richard Biener @ 2015-02-25 13:33 UTC (permalink / raw)
  To: Kai Tietz; +Cc: GCC Patches, Jakub Jelinek

On Wed, Feb 25, 2015 at 2:10 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> So, I did full regression-test for following patch:
>
> ChangeLog
>
> 2015-02-25  Richard Biener  <rguenther@suse.de>
>     Kai Tietz  <ktietz@redhat.com>
>
>     PR tree-optimization/61917
>     * tree-vect-loop.c (vectorizable_reduction): Allow
>     vect_internal_def without reduction to exit graceful.
>
> ChagneLog testsuite/
>
> 2015-02-25  Kai Tietz  <ktietz@redhat.com>
>
>     PR tree-optimization/61917
>     * gcc.dg/vect/vect-pr61917.c: New file.
>
> Tested for x86_64-unkown-linux.  Ok for apply?

Ok.

Thanks,
Richard.

> Regards,
> Kai
>
> Index: tree-vect-loop.c
> ===================================================================
> --- tree-vect-loop.c    (Revision 220958)
> +++ tree-vect-loop.c    (Arbeitskopie)
> @@ -4981,6 +4981,12 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>    if (!vectype_in)
>      vectype_in = tem;
>    gcc_assert (is_simple_use);
> +  if (!found_nested_cycle_def)
> +    reduc_def_stmt = def_stmt;
> +
> +  if (gimple_code (reduc_def_stmt) != GIMPLE_PHI)
> +    return false;
> +
>    if (!(dt == vect_reduction_def
>      || dt == vect_nested_cycle
>      || ((dt == vect_internal_def || dt == vect_external_def
> @@ -4993,10 +4999,7 @@ vectorizable_reduction (gimple stmt, gimple_stmt_i
>        gcc_assert (orig_stmt);
>        return false;
>      }
> -  if (!found_nested_cycle_def)
> -    reduc_def_stmt = def_stmt;
>
> -  gcc_assert (gimple_code (reduc_def_stmt) == GIMPLE_PHI);
>    if (orig_stmt)
>      gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo,
>                                                         reduc_def_stmt,
> Index: gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
> ===================================================================
> --- /dev/null
> +++ gcc/gcc/testsuite/gcc.dg/vect/vect-pr61917.c
> @@ -0,0 +1,13 @@
> +/* { dg-do compile } */
> +/* { dg-additional-options "-O3" } */
> +
> +int a, b, c, d;
> +
> +int
> +fn1 ()
> +{
> +  for (; c; c++)
> +    for (b = 0; b < 2; b++)
> +      d = a - d;
> +  return d;
> +}

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 13:26         ` Kai Tietz
  2015-02-25 13:33           ` Richard Biener
@ 2015-02-25 17:01           ` H.J. Lu
  2015-02-26 12:13             ` Alex Velenko
  1 sibling, 1 reply; 11+ messages in thread
From: H.J. Lu @ 2015-02-25 17:01 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Richard Biener, GCC Patches, Jakub Jelinek

On Wed, Feb 25, 2015 at 5:10 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> So, I did full regression-test for following patch:
>
> ChangeLog
>
> 2015-02-25  Richard Biener  <rguenther@suse.de>
>     Kai Tietz  <ktietz@redhat.com>
>
>     PR tree-optimization/61917
>     * tree-vect-loop.c (vectorizable_reduction): Allow
>     vect_internal_def without reduction to exit graceful.
>

I think it caused:

FAIL: gcc.dg/pr56350.c (internal compiler error)
FAIL: gcc.dg/pr56350.c (test for excess errors)

[hjl@gnu-6 gcc]$ ./xgcc -B./ -O -ftree-vectorize
/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/pr56350.c
/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/pr56350.c: In
function ‘f’:
/export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/pr56350.c:8:1:
internal compiler error: Segmentation fault
 f (void)
 ^
0xd1f836 crash_signal
/export/gnu/import/git/sources/gcc/gcc/toplev.c:383
0xfaf59a gimple_code
/export/gnu/import/git/sources/gcc/gcc/gimple.h:1553
0xfbd855 vectorizable_reduction(gimple_statement_base*,
gimple_stmt_iterator*, gimple_statement_base**, _slp_tree*)
/export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:4987
0xfabc86 vect_analyze_stmt(gimple_statement_base*, bool*, _slp_tree*)
/export/gnu/import/git/sources/gcc/gcc/tree-vect-stmts.c:7170
0xfb50c9 vect_analyze_loop_operations
/export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:1539
0xfb58cc vect_analyze_loop_2
/export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:1800
0xfb5c70 vect_analyze_loop(loop*)
/export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:1898
0xfd558f vectorize_loops()
/export/gnu/import/git/sources/gcc/gcc/tree-vectorizer.c:451
0xed3699 execute
/export/gnu/import/git/sources/gcc/gcc/tree-ssa-loop.c:295
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-6 gcc]$


-- 
H.J.

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-25 17:01           ` H.J. Lu
@ 2015-02-26 12:13             ` Alex Velenko
  2015-02-26 12:22               ` Jakub Jelinek
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Velenko @ 2015-02-26 12:13 UTC (permalink / raw)
  To: H.J. Lu, Kai Tietz; +Cc: Richard Biener, GCC Patches, Jakub Jelinek

On 25/02/15 16:51, H.J. Lu wrote:
> On Wed, Feb 25, 2015 at 5:10 AM, Kai Tietz <ktietz70@googlemail.com> wrote:
>> Hello,
>>
>> So, I did full regression-test for following patch:
>>
>> ChangeLog
>>
>> 2015-02-25  Richard Biener  <rguenther@suse.de>
>>      Kai Tietz  <ktietz@redhat.com>
>>
>>      PR tree-optimization/61917
>>      * tree-vect-loop.c (vectorizable_reduction): Allow
>>      vect_internal_def without reduction to exit graceful.
>>
>
> I think it caused:
>
> FAIL: gcc.dg/pr56350.c (internal compiler error)
> FAIL: gcc.dg/pr56350.c (test for excess errors)
>
> [hjl@gnu-6 gcc]$ ./xgcc -B./ -O -ftree-vectorize
> /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/pr56350.c
> /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/pr56350.c: In
> function ‘f’:
> /export/gnu/import/git/sources/gcc/gcc/testsuite/gcc.dg/pr56350.c:8:1:
> internal compiler error: Segmentation fault
>   f (void)
>   ^
> 0xd1f836 crash_signal
> /export/gnu/import/git/sources/gcc/gcc/toplev.c:383
> 0xfaf59a gimple_code
> /export/gnu/import/git/sources/gcc/gcc/gimple.h:1553
> 0xfbd855 vectorizable_reduction(gimple_statement_base*,
> gimple_stmt_iterator*, gimple_statement_base**, _slp_tree*)
> /export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:4987
> 0xfabc86 vect_analyze_stmt(gimple_statement_base*, bool*, _slp_tree*)
> /export/gnu/import/git/sources/gcc/gcc/tree-vect-stmts.c:7170
> 0xfb50c9 vect_analyze_loop_operations
> /export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:1539
> 0xfb58cc vect_analyze_loop_2
> /export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:1800
> 0xfb5c70 vect_analyze_loop(loop*)
> /export/gnu/import/git/sources/gcc/gcc/tree-vect-loop.c:1898
> 0xfd558f vectorize_loops()
> /export/gnu/import/git/sources/gcc/gcc/tree-vectorizer.c:451
> 0xed3699 execute
> /export/gnu/import/git/sources/gcc/gcc/tree-ssa-loop.c:295
> Please submit a full bug report,
> with preprocessed source if appropriate.
> Please include the complete backtrace with any bug report.
> See <http://gcc.gnu.org/bugs.html> for instructions.
> [hjl@gnu-6 gcc]$
>
>
Hi,
This patch also breaks gcc.dg/pr56350.c for aarch64-none-elf, 
arm-none-eabi and other arm targets. Failure looks very similar:

src/gcc/gcc/testsuite/gcc.dg/pr56350.c: In function 'f':

src/gcc/gcc/testsuite/gcc.dg/pr56350.c:8:1: internal compiler error: 
Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

compiler exited with status 1
output is:
src/gcc/gcc/testsuite/gcc.dg/pr56350.c: In function 'f':

src/gcc/gcc/testsuite/gcc.dg/pr56350.c:8:1: internal compiler error: 
Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

Kind regards,
Alex

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-26 12:13             ` Alex Velenko
@ 2015-02-26 12:22               ` Jakub Jelinek
  2015-02-26 14:08                 ` Alex Velenko
  0 siblings, 1 reply; 11+ messages in thread
From: Jakub Jelinek @ 2015-02-26 12:22 UTC (permalink / raw)
  To: Alex Velenko; +Cc: H.J. Lu, Kai Tietz, Richard Biener, GCC Patches

On Thu, Feb 26, 2015 at 12:03:46PM +0000, Alex Velenko wrote:
> This patch also breaks gcc.dg/pr56350.c for aarch64-none-elf, arm-none-eabi
> and other arm targets. Failure looks very similar:

Just svn update?  r220987 should fix this.

	Jakub

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

* Re: [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913
  2015-02-26 12:22               ` Jakub Jelinek
@ 2015-02-26 14:08                 ` Alex Velenko
  0 siblings, 0 replies; 11+ messages in thread
From: Alex Velenko @ 2015-02-26 14:08 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: H.J. Lu, Kai Tietz, Richard Biener, GCC Patches

Hi Jakub,
Just tested with latest svn update. The issue is indeed gone.
Kind regards,
Alex

On 26/02/15 12:12, Jakub Jelinek wrote:
> On Thu, Feb 26, 2015 at 12:03:46PM +0000, Alex Velenko wrote:
>> This patch also breaks gcc.dg/pr56350.c for aarch64-none-elf, arm-none-eabi
>> and other arm targets. Failure looks very similar:
>
> Just svn update?  r220987 should fix this.
>
> 	Jakub
>

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

end of thread, other threads:[~2015-02-26 13:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-25 10:20 [patch]: [Bug tree-optimization/61917] [4.9/5 Regression] ICE on valid code at -O3 on x86_64-linux-gnu in vectorizable_reduction, at tree-vect-loop.c:4913 Kai Tietz
2015-02-25 11:04 ` Richard Biener
2015-02-25 11:16   ` Kai Tietz
2015-02-25 11:50     ` Richard Biener
2015-02-25 12:38       ` Kai Tietz
2015-02-25 13:26         ` Kai Tietz
2015-02-25 13:33           ` Richard Biener
2015-02-25 17:01           ` H.J. Lu
2015-02-26 12:13             ` Alex Velenko
2015-02-26 12:22               ` Jakub Jelinek
2015-02-26 14:08                 ` Alex Velenko

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