diff mbox

[PR,45241] : CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre

Message ID OF95A4C39E.B52F9EC9-ONC225777D.00212EAE-C225777D.002233A0@il.ibm.com
State New
Headers show

Commit Message

Ira Rosen Aug. 12, 2010, 6:13 a.m. UTC
"Fang, Changpeng" <Changpeng.Fang@amd.com> wrote on 11/08/2010 08:36:42 PM:

> Hi,
>
> Attached patch fixes bug 45241: CPU2006 465.tonto ICE in the
> vectorizer with -fno-tree-pre.
>
> When the vectorizer tries to recognize the dot_prod pattern, it
> traces the statements chain
> outside the loop. As a result, ICE occurs when it tries to access
> the stmt_vinfo for a stmt
> outside the loop.
>
> This patch stops the pattern searching when the statement is already
> outside the loop.
> It passed bootstrapping in both the trunk and 4.5 branch.

On which target? What about regtesting?

>
> The bug is 4.5/4.6 regression, and it prevents benchmarking for
> cpu2006 with no PRE.
>
> Is it OK to commit to 4,5 branch (and 4.6 ?
>
> Thanks,
>
> Changpeng
>


	* gcc/tree-vect-patterns.c (vect_recog_dot_prod_pattern): Give

No need in gcc/ before tree-vect-patterns.c.

	up dor_prod pattern searching if a stmt is outside the loop.

dot prod

	* gcc.dg/vect/pr45241.c: New.
---
 gcc/testsuite/gcc.dg/vect/pr45241.c |   19 +++++++++++++++++++
 gcc/tree-vect-patterns.c            |    5 +++++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/vect/pr45241.c

+
+  return sum;
+}
+

Please add

/* { dg-final { cleanup-tree-dump "vect" } } */

to the test.

Thanks,
Ira
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/pr45241.c
b/gcc/testsuite/gcc.dg/vect/pr45241.c
new file mode 100644
index 0000000..c04cf04
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr45241.c
@@ -0,0 +1,19 @@ 
+/* PR tree-optimization/45241 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-pre" } */

Instead of using dg-options please change the name of the test to
no-tree-pre-pr45241.c.

+
+int
+foo (short x)
+{
+  short i, y;
+  int sum;
+
+  for (i = 0; i < x; i++)
+    y = x * i;
+
+  for (i = x; i > 0; i--)
+    sum += y;