public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/39675]  New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
@ 2009-04-07 13:13 rguenth at gcc dot gnu dot org
  2009-04-07 13:14 ` [Bug tree-optimization/39675] " rguenth at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-07 13:13 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2228 bytes --]

typedef struct {
    float vertexAttrib[16][4];
    float vertexAttribPre[16][4];
    float rasterAttrib[16][4];
    float rasterAttribPre[16][4];
} CRCurrentState;
void crStateCurrentInit(CRCurrentState *c)
{
  unsigned int i;
  for (i = 0; i < 16; i++)
    {
      (c->vertexAttribPre[i])[0] = (c->vertexAttrib[i])[0];
      (c->vertexAttribPre[i])[1] = (c->vertexAttrib[i])[1];
      (c->vertexAttribPre[i])[2] = (c->vertexAttrib[i])[2];
      (c->vertexAttribPre[i])[3] = (c->vertexAttrib[i])[3];
      (c->rasterAttrib[i])[0] = (c->vertexAttrib[i])[0];
      (c->rasterAttrib[i])[1] = (c->vertexAttrib[i])[1];
      (c->rasterAttrib[i])[2] = (c->vertexAttrib[i])[2];
      (c->rasterAttrib[i])[3] = (c->vertexAttrib[i])[3];
      (c->rasterAttribPre[i])[0] = (c->vertexAttrib[i])[0];
      (c->rasterAttribPre[i])[1] = (c->vertexAttrib[i])[1];
      (c->rasterAttribPre[i])[2] = (c->vertexAttrib[i])[2];
      (c->rasterAttribPre[i])[3] = (c->vertexAttrib[i])[3];
    }
}

gcc-4.4 -S bug492696.3.i -o /dev/null -O3
bug492696.3.i: In function ‘crStateCurrentInit’:
bug492696.3.i:7: internal compiler error: in vect_get_vec_def_for_operand, at
tree-vect-transform.c:1999
Please submit a full bug report,
with preprocessed source if appropriate.

It looks like the vectorizer gets confused by predictive commoning
(-fno-predictive-commoning fixes this).  On trunk FRE already optimizes
the redundant loads so no SSA_NAME copies rename (which appearantly
confuse the vectorizer):

  # VUSE <SMT.11_58>
  D.1603_6 = c_5(D)->vertexAttrib[i_57][0];
  c___vertexAttribc__I_I_I_lsm0.28_56 = D.1603_6;
...
  D.1603_18 = c___vertexAttribc__I_I_I_lsm0.28_56;
  # SMT.11_47 = VDEF <SMT.11_46>
  c_5(D)->rasterAttrib[i_57][0] = D.1603_18;


-- 
           Summary: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at
                    tree-vect-transform.c:1999
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
@ 2009-04-07 13:14 ` rguenth at gcc dot gnu dot org
  2009-04-08  6:40 ` irar at il dot ibm dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-07 13:14 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
  2009-04-07 13:14 ` [Bug tree-optimization/39675] " rguenth at gcc dot gnu dot org
@ 2009-04-08  6:40 ` irar at il dot ibm dot com
  2009-04-08 11:17 ` irar at il dot ibm dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: irar at il dot ibm dot com @ 2009-04-08  6:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

irar at il dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |irar at il dot ibm dot com
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-04-08 06:40:25
               date|                            |


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
  2009-04-07 13:14 ` [Bug tree-optimization/39675] " rguenth at gcc dot gnu dot org
  2009-04-08  6:40 ` irar at il dot ibm dot com
@ 2009-04-08 11:17 ` irar at il dot ibm dot com
  2009-04-14  9:50 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: irar at il dot ibm dot com @ 2009-04-08 11:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from irar at il dot ibm dot com  2009-04-08 11:17 -------
A testcase for 4.5:

#define N 128

int out[N*4], out2[N], in[N*4];

void
foo ()
{
  int i, a0, a1, a2, a3;

  for (i = 0; i < N; i++)
    {
      a0 = in[i*4];
      a1 = in[i*4 + 1];
      a2 = in[i*4 + 2];
      a3 = in[i*4 + 3];

      out[i*4] = a0;
      out[i*4 + 1] = a1;
      out[i*4 + 2] = a2;
      out[i*4 + 3] = a3;

      out2[i] = a0;
    }
}

Fails with
internal compiler error: in vect_get_vec_def_for_operand, at
tree-vect-stmts.c:940
(on powerpc64-suse-linux with -O3 -maltivec)

The bug is in decision whether a statement must be "loop-vectorized" in a
addition to SLP. Here is a patch (for 4.4) that I am testing:

Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c       (revision 145711)
+++ tree-vect-transform.c       (working copy)
@@ -8459,20 +8459,11 @@
                  if (vect_print_dump_info (REPORT_DETAILS))
                    fprintf (vect_dump, "=== scheduling SLP instances ===");

-                 is_store = vect_schedule_slp (loop_vinfo);
-
-                 /* IS_STORE is true if STMT is a store. Stores cannot be of
-                    hybrid SLP type. They are removed in
-                    vect_schedule_slp_instance and their vinfo is destroyed.
*/
-                 if (is_store)
-                   {
-                     gsi_next (&si);
-                     continue;
-                   }
-               }
+                 vect_schedule_slp (loop_vinfo);
+                }

              /* Hybrid SLP stmts must be vectorized in addition to SLP.  */
-             if (PURE_SLP_STMT (stmt_info))
+             if (!vinfo_for_stmt (stmt) || PURE_SLP_STMT (stmt_info))
                {
                  gsi_next (&si);
                  continue;


-- 


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-04-08 11:17 ` irar at il dot ibm dot com
@ 2009-04-14  9:50 ` jakub at gcc dot gnu dot org
  2009-04-20  7:09 ` irar at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-04-14  9:50 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-04-14  9:50 ` jakub at gcc dot gnu dot org
@ 2009-04-20  7:09 ` irar at gcc dot gnu dot org
  2009-04-20 11:26 ` irar at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: irar at gcc dot gnu dot org @ 2009-04-20  7:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from irar at gcc dot gnu dot org  2009-04-20 07:09 -------
Subject: Bug 39675

Author: irar
Date: Mon Apr 20 07:09:01 2009
New Revision: 146365

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146365
Log:

        PR tree-optimization/39675
        * tree-vect-transform.c (vect_transform_loop): Remove currently
        redundant check of the return code of vect_schedule_slp. Check that
        stmt_vec_info still exists for the statement, before checking its
        vectorization type.


Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/O3-pr39675-1.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_4-branch/gcc/tree-vect-transform.c


-- 


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-04-20  7:09 ` irar at gcc dot gnu dot org
@ 2009-04-20 11:26 ` irar at gcc dot gnu dot org
  2009-04-20 11:31 ` irar at il dot ibm dot com
  2009-04-20 11:32 ` rguenther at suse dot de
  7 siblings, 0 replies; 9+ messages in thread
From: irar at gcc dot gnu dot org @ 2009-04-20 11:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from irar at gcc dot gnu dot org  2009-04-20 11:26 -------
Subject: Bug 39675

Author: irar
Date: Mon Apr 20 11:26:18 2009
New Revision: 146399

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146399
Log:
        PR tree-optimization/39675
        * tree-vect-loop.c (vect_transform_loop): Remove currently redundant 
        check of the return code of vect_schedule_slp. Check that stmt_vec_info
        still exists for the statement, before checking its vectorization type.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c


-- 


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-04-20 11:26 ` irar at gcc dot gnu dot org
@ 2009-04-20 11:31 ` irar at il dot ibm dot com
  2009-04-20 11:32 ` rguenther at suse dot de
  7 siblings, 0 replies; 9+ messages in thread
From: irar at il dot ibm dot com @ 2009-04-20 11:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from irar at il dot ibm dot com  2009-04-20 11:30 -------
Fixed.


-- 

irar at il dot ibm dot com changed:

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


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


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

* [Bug tree-optimization/39675] [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999
  2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-04-20 11:31 ` irar at il dot ibm dot com
@ 2009-04-20 11:32 ` rguenther at suse dot de
  7 siblings, 0 replies; 9+ messages in thread
From: rguenther at suse dot de @ 2009-04-20 11:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenther at suse dot de  2009-04-20 11:32 -------
Subject: Re:  [4.4 Regression] ICE in
 vect_get_vec_def_for_operand, at tree-vect-transform.c:1999

On Mon, 20 Apr 2009, irar at il dot ibm dot com wrote:

> ------- Comment #4 from irar at il dot ibm dot com  2009-04-20 11:30 -------
> Fixed.

Thanks!


-- 


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


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

end of thread, other threads:[~2009-04-20 11:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-07 13:13 [Bug tree-optimization/39675] New: [4.4 Regression] ICE in vect_get_vec_def_for_operand, at tree-vect-transform.c:1999 rguenth at gcc dot gnu dot org
2009-04-07 13:14 ` [Bug tree-optimization/39675] " rguenth at gcc dot gnu dot org
2009-04-08  6:40 ` irar at il dot ibm dot com
2009-04-08 11:17 ` irar at il dot ibm dot com
2009-04-14  9:50 ` jakub at gcc dot gnu dot org
2009-04-20  7:09 ` irar at gcc dot gnu dot org
2009-04-20 11:26 ` irar at gcc dot gnu dot org
2009-04-20 11:31 ` irar at il dot ibm dot com
2009-04-20 11:32 ` rguenther at suse dot de

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