public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45241]  New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
@ 2010-08-09 17:48 changpeng dot fang at amd dot com
  2010-08-09 17:52 ` [Bug tree-optimization/45241] " changpeng dot fang at amd dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-09 17:48 UTC (permalink / raw)
  To: gcc-bugs

With gcc 4.6:
gfortran  -c -o diis.fppized.o -O3 -fno-tree-pre -march=amdfam10 -m64
diis.fppized.f90

diis.fppized.f90: In function 'extrapolate':
diis.fppized.f90:882:0: internal compiler error: vector VEC(vec_void_p,base)
index domain error, in vinfo_for_stmt at tree-vectorizer.h:595
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions

This is invoked in "vect_recog_dot_prod_pattern":
stmt_vinfo = vinfo_for_stmt (stmt);

Where "stmt" is not inside the loop, and thus stmt_vinfo was not set up.


-- 
           Summary: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-
                    pre
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: changpeng dot fang at amd dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
@ 2010-08-09 17:52 ` changpeng dot fang at amd dot com
  2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-09 17:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from changpeng dot fang at amd dot com  2010-08-09 17:52 -------
This patch should be a valid fix, because the recognition of the dot_prod
pattern is known to be fail at this point if the stmt is outside the loop.
(I am not sure whether we should not see this case in the vectorizer at this
point -- should previous analysis already filter out?):

diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 19f0ae6..5f81a73 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -259,6 +259,10 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree
*type_in, tree *type_out)
      inside the loop (in case we are analyzing an outer-loop).  */
   if (!is_gimple_assign (stmt))
     return NULL;
+
+  if (!flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
+    return NULL;
+
   stmt_vinfo = vinfo_for_stmt (stmt);
   gcc_assert (stmt_vinfo);
   if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_internal_def)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
  2010-08-09 17:52 ` [Bug tree-optimization/45241] " changpeng dot fang at amd dot com
@ 2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
  2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-10  8:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-08-10 08:58 -------
*** Bug 45239 has been marked as a duplicate of this bug. ***


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
  2010-08-09 17:52 ` [Bug tree-optimization/45241] " changpeng dot fang at amd dot com
  2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
@ 2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
  2010-08-10  9:07 ` irar at il dot ibm dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-10  8:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-08-10 08:58 -------
Can you attach a testcase please?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (2 preceding siblings ...)
  2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
@ 2010-08-10  9:07 ` irar at il dot ibm dot com
  2010-08-10 10:24 ` irar at il dot ibm dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: irar at il dot ibm dot com @ 2010-08-10  9:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from irar at il dot ibm dot com  2010-08-10 09:06 -------
I am testing the same patch as in comment #1.

Testcase that shows the problem:

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;

  return sum;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (3 preceding siblings ...)
  2010-08-10  9:07 ` irar at il dot ibm dot com
@ 2010-08-10 10:24 ` irar at il dot ibm dot com
  2010-08-10 12:05 ` dominiq at lps dot ens dot fr
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: irar at il dot ibm dot com @ 2010-08-10 10:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from irar at il dot ibm dot com  2010-08-10 10:23 -------
(In reply to comment #1)
> This patch should be a valid fix, because the recognition of the dot_prod
> pattern is known to be fail at this point if the stmt is outside the loop.
> (I am not sure whether we should not see this case in the vectorizer at this
> point -- should previous analysis already filter out?):
> 

I don't understand this. Where do we check if the stmt (which one?) is outside
the loop? 


> diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
> index 19f0ae6..5f81a73 100644
> --- a/gcc/tree-vect-patterns.c
> +++ b/gcc/tree-vect-patterns.c
> @@ -259,6 +259,10 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree
> *type_in, tree *type_out)
>       inside the loop (in case we are analyzing an outer-loop).  */
>    if (!is_gimple_assign (stmt))
>      return NULL;
> +
> +  if (!flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
> +    return NULL;
> +
>    stmt_vinfo = vinfo_for_stmt (stmt);
>    gcc_assert (stmt_vinfo);
>    if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_internal_def)
> 

I was looking at PR 45239 and didn't notice that there is another PR and didn't
see this comment. So I tested the same fix (successfully on x86_64-suse-linux).
You can commit it if you like (just please notice, that the bug exists on 4.5
as well). 

Thanks,
Ira


-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-08-10 10:24:00
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (4 preceding siblings ...)
  2010-08-10 10:24 ` irar at il dot ibm dot com
@ 2010-08-10 12:05 ` dominiq at lps dot ens dot fr
  2010-08-10 21:44 ` [Bug tree-optimization/45241] [4.5/4.6 Regression] " changpeng dot fang at amd dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: dominiq at lps dot ens dot fr @ 2010-08-10 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dominiq at lps dot ens dot fr  2010-08-10 12:04 -------
This is a [4.5/4.6 Regression]: the test in comment #4 compiles with gcc
version 4.4.4 (GCC).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (5 preceding siblings ...)
  2010-08-10 12:05 ` dominiq at lps dot ens dot fr
@ 2010-08-10 21:44 ` changpeng dot fang at amd dot com
  2010-08-11  0:27 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-10 21:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from changpeng dot fang at amd dot com  2010-08-10 21:44 -------
(In reply to comment #5)
> (In reply to comment #1)
> > This patch should be a valid fix, because the recognition of the dot_prod
> > pattern is known to be fail at this point if the stmt is outside the loop.
> > (I am not sure whether we should not see this case in the vectorizer at this
> > point -- should previous analysis already filter out?):
> > 
> 
> I don't understand this. Where do we check if the stmt (which one?) is outside
> the loop? 

Forget about this part of the comment (The vectorization analysis is correct,
and it is just that the pattern recognition traces the chain outside the loop). 

> I was looking at PR 45239 and didn't notice that there is another PR and didn't
> see this comment. So I tested the same fix (successfully on x86_64-suse-linux).
> You can commit it if you like (just please notice, that the bug exists on 4.5
> as well). 
> 

I am going to add your testcase (in comment #4), and doing bootstraping, and
then commit to the trunk and gcc 4.5 branch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (6 preceding siblings ...)
  2010-08-10 21:44 ` [Bug tree-optimization/45241] [4.5/4.6 Regression] " changpeng dot fang at amd dot com
@ 2010-08-11  0:27 ` pinskia at gcc dot gnu dot org
  2010-08-30 15:55 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-08-11  0:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (7 preceding siblings ...)
  2010-08-11  0:27 ` pinskia at gcc dot gnu dot org
@ 2010-08-30 15:55 ` rguenth at gcc dot gnu dot org
  2010-08-30 16:38 ` changpeng dot fang at amd dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-30 15:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2010-08-30 15:54 -------
ISTR a review of a patch?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (8 preceding siblings ...)
  2010-08-30 15:55 ` rguenth at gcc dot gnu dot org
@ 2010-08-30 16:38 ` changpeng dot fang at amd dot com
  2010-08-30 16:39 ` changpeng dot fang at amd dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-30 16:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from changpeng dot fang at amd dot com  2010-08-30 16:37 -------
Review approval for the trunk:
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00931.html

Review Approval for 4.5 branch:
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02112.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (9 preceding siblings ...)
  2010-08-30 16:38 ` changpeng dot fang at amd dot com
@ 2010-08-30 16:39 ` changpeng dot fang at amd dot com
  2010-08-30 16:40 ` changpeng dot fang at amd dot com
  2010-08-30 16:41 ` changpeng dot fang at amd dot com
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-30 16:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from changpeng dot fang at amd dot com  2010-08-30 16:39 -------
r163207 - in /trunk/gcc: ChangeLog testsuite/Ch...

    * From: cfang at gcc dot gnu dot org
    * To: gcc-cvs at gcc dot gnu dot org
    * Date: Thu, 12 Aug 2010 22:18:34 -0000
    * Subject: r163207 - in /trunk/gcc: ChangeLog testsuite/Ch...

Author: cfang
Date: Thu Aug 12 22:18:32 2010
New Revision: 163207

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163207
Log:
pr45241 give up dot_prod pattern searching if stmt is outside the loop.

        * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Give
        up dot_prod pattern searching if a stmt is outside the loop.

        * gcc.dg/vect/no-tree-pre-pr45241.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/no-tree-pre-pr45241.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-patterns.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (10 preceding siblings ...)
  2010-08-30 16:39 ` changpeng dot fang at amd dot com
@ 2010-08-30 16:40 ` changpeng dot fang at amd dot com
  2010-08-30 16:41 ` changpeng dot fang at amd dot com
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-30 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from changpeng dot fang at amd dot com  2010-08-30 16:40 -------
r163286 - in /branches/gcc-4_5-branch/gcc: Chan...

    * From: cfang at gcc dot gnu dot org
    * To: gcc-cvs at gcc dot gnu dot org
    * Date: Mon, 16 Aug 2010 21:02:30 -0000
    * Subject: r163286 - in /branches/gcc-4_5-branch/gcc: Chan...

Author: cfang
Date: Mon Aug 16 21:02:29 2010
New Revision: 163286

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163286
Log:
pr45241 give up dot_prod pattern searching if stmt is outside the loop.

        * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Give
        up dot_prod pattern searching if a stmt is outside the loop.

        * gcc.dg/vect/no-tree-pre-pr45241.c: New.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/vect/no-tree-pre-pr45241.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree-vect-patterns.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

* [Bug tree-optimization/45241] [4.5/4.6 Regression] CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre
  2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
                   ` (11 preceding siblings ...)
  2010-08-30 16:40 ` changpeng dot fang at amd dot com
@ 2010-08-30 16:41 ` changpeng dot fang at amd dot com
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng dot fang at amd dot com @ 2010-08-30 16:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from changpeng dot fang at amd dot com  2010-08-30 16:41 -------
Fixed!


-- 

changpeng dot fang at amd dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45241


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

end of thread, other threads:[~2010-08-30 16:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-09 17:48 [Bug tree-optimization/45241] New: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre changpeng dot fang at amd dot com
2010-08-09 17:52 ` [Bug tree-optimization/45241] " changpeng dot fang at amd dot com
2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
2010-08-10  8:59 ` rguenth at gcc dot gnu dot org
2010-08-10  9:07 ` irar at il dot ibm dot com
2010-08-10 10:24 ` irar at il dot ibm dot com
2010-08-10 12:05 ` dominiq at lps dot ens dot fr
2010-08-10 21:44 ` [Bug tree-optimization/45241] [4.5/4.6 Regression] " changpeng dot fang at amd dot com
2010-08-11  0:27 ` pinskia at gcc dot gnu dot org
2010-08-30 15:55 ` rguenth at gcc dot gnu dot org
2010-08-30 16:38 ` changpeng dot fang at amd dot com
2010-08-30 16:39 ` changpeng dot fang at amd dot com
2010-08-30 16:40 ` changpeng dot fang at amd dot com
2010-08-30 16:41 ` changpeng dot fang at amd dot com

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