public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/33953]  New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
@ 2007-10-31  0:40 bero at arklinux dot org
  2007-10-31  0:42 ` [Bug rtl-optimization/33953] " bero at arklinux dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bero at arklinux dot org @ 2007-10-31  0:40 UTC (permalink / raw)
  To: gcc-bugs

$ gcc -O3 -c drawgfx.i
src/emu/drawgfx.c: In function 'blockmove_NtoN_blend_noremap32':
src/emu/drawgfx.c:4760: internal compiler error: vector VEC(tree,base) index
domain error, in vectorizable_operation at tree-vect-transform.c:4017
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Works correctly on x86_32, and on x86_64 with -O2 instead of -O3.


-- 
           Summary: [4.3 regression] internal compiler error: vector
                    VEC(tree,base) index domain error, in
                    vectorizable_operation at tree-vect-transform.c:4017
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bero at arklinux dot org
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


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

* [Bug rtl-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
@ 2007-10-31  0:42 ` bero at arklinux dot org
  2007-10-31  0:49 ` [Bug tree-optimization/33953] " pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: bero at arklinux dot org @ 2007-10-31  0:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bero at arklinux dot org  2007-10-31 00:42 -------
Created an attachment (id=14444)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14444&action=view)
bzip2-ed preprocessed source


-- 


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
  2007-10-31  0:42 ` [Bug rtl-optimization/33953] " bero at arklinux dot org
@ 2007-10-31  0:49 ` pinskia at gcc dot gnu dot org
  2007-10-31  9:47 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-31  0:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
          Component|rtl-optimization            |tree-optimization
   Target Milestone|---                         |4.3.0


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
  2007-10-31  0:42 ` [Bug rtl-optimization/33953] " bero at arklinux dot org
  2007-10-31  0:49 ` [Bug tree-optimization/33953] " pinskia at gcc dot gnu dot org
@ 2007-10-31  9:47 ` rguenth at gcc dot gnu dot org
  2007-10-31 10:31 ` ubizjak at gmail dot com
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-10-31  9:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-10-31 09:47 -------
Uh, the VEC_* stuff used there looks like a mess.  It's not clear who allocates
and what the size should be.  For example vect_get_vec_defs_for_stmt_copy
doesn't allocate the VECs which is exactly what causes the problem here.

Reducing.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dorit at gcc dot gnu dot org


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (2 preceding siblings ...)
  2007-10-31  9:47 ` rguenth at gcc dot gnu dot org
@ 2007-10-31 10:31 ` ubizjak at gmail dot com
  2007-10-31 10:37 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ubizjak at gmail dot com @ 2007-10-31 10:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ubizjak at gmail dot com  2007-10-31 10:31 -------
Smaller testcase:

--cut here--
void
blockmove_NtoN_blend_noremap32 (const unsigned int *srcdata, int srcwidth,
                                int srcheight, int srcmodulo,
                                unsigned int *dstdata, int dstmodulo,
                                int srcshift)
{
  unsigned int *end;
  srcmodulo -= srcwidth;
  dstmodulo -= srcwidth;
  while (srcheight)
    {
      end = dstdata + srcwidth;
      while (dstdata <= end - 8)
        {
          dstdata[0] |= srcdata[0] << srcshift;
          dstdata[1] |= srcdata[1] << srcshift;
          dstdata[2] |= srcdata[2] << srcshift;
          dstdata[3] |= srcdata[3] << srcshift;
          dstdata[4] |= srcdata[4] << srcshift;
          dstdata[5] |= srcdata[5] << srcshift;
          dstdata[6] |= srcdata[6] << srcshift;
          dstdata[7] |= srcdata[7] << srcshift;
          dstdata += 8;
          srcdata += 8;
        }
      while (dstdata < end)
        *(dstdata++) |= *(srcdata++) << srcshift;
      srcdata += srcmodulo;
      dstdata += dstmodulo;
      srcheight--;
    }
}
--cut here--

Confirmed on x86_64 and i686-sse2 with -O2 -ftree-vectorize.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-31 10:31:46
               date|                            |


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (3 preceding siblings ...)
  2007-10-31 10:31 ` ubizjak at gmail dot com
@ 2007-10-31 10:37 ` rguenth at gcc dot gnu dot org
  2007-10-31 10:57 ` irar at il dot ibm dot com
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-10-31 10:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-10-31 10:37 -------
typedef unsigned int UINT32;
void blockmove_NtoN_blend_noremap32 ( const UINT32 *srcdata,int srcwidth,int
srcheight,int srcmodulo, UINT32 *dstdata,int dstmodulo, int srcshift) {
 UINT32 *end;
 while (srcheight) {
  while (dstdata <= end - 8) {
  dstdata[0] |= srcdata[0] << srcshift;
  dstdata[1] |= srcdata[1] << srcshift;
  dstdata[2] |= srcdata[2] << srcshift;
  dstdata[3] |= srcdata[3] << srcshift;
  dstdata[4] |= srcdata[4] << srcshift;
  dstdata[5] |= srcdata[5] << srcshift;
  dstdata[6] |= srcdata[6] << srcshift;
  dstdata[7] |= srcdata[7] << srcshift;
  dstdata += 8;
  srcdata += 8;
  }
  }
}


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2007-10-31 10:31:46         |2007-10-31 10:37:29
               date|                            |


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (4 preceding siblings ...)
  2007-10-31 10:37 ` rguenth at gcc dot gnu dot org
@ 2007-10-31 10:57 ` irar at il dot ibm dot com
  2007-10-31 11:22 ` irar at il dot ibm dot com
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-31 10:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from irar at il dot ibm dot com  2007-10-31 10:57 -------
The problem here is that more than one vector stmts are used to vectorize (SLP)
this loop, while only one vector operand is created in case of vector shift
with scalar argument.

I am preparing a patch.

Thanks,
Ira


-- 


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (5 preceding siblings ...)
  2007-10-31 10:57 ` irar at il dot ibm dot com
@ 2007-10-31 11:22 ` irar at il dot ibm dot com
  2007-10-31 12:58 ` irar at il dot ibm dot com
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-31 11:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from irar at il dot ibm dot com  2007-10-31 11:22 -------
(In reply to comment #2)
> Uh, the VEC_* stuff used there looks like a mess.  It's not clear who allocates
> and what the size should be. 

I'll take a look and fix if necessary.

> For example vect_get_vec_defs_for_stmt_copy
> doesn't allocate the VECs which is exactly what causes the problem here.

vect_get_vec_defs_for_stmt_copy is not called here, it is used to create vector
copies in case of multiple types in the loop. It should reuse the VEC used for
the first copy. I think, there is indeed a problem here. We should overwrite
the  existing entries and not push the new ones. I'll look into this. 

> 
> Reducing.
> 

Thanks,
Ira


-- 


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (6 preceding siblings ...)
  2007-10-31 11:22 ` irar at il dot ibm dot com
@ 2007-10-31 12:58 ` irar at il dot ibm dot com
  2007-11-05  3:11 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: irar at il dot ibm dot com @ 2007-10-31 12:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from irar at il dot ibm dot com  2007-10-31 12:57 -------
I am testing the following patch:

Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c       (revision 129627)
+++ tree-vect-transform.c       (working copy)
@@ -3915,10 +3915,14 @@ vectorizable_operation (tree stmt, block
   /* Handle def.  */
   vec_dest = vect_create_destination_var (scalar_dest, vectype);

-  if (!slp_node)
-    vec_oprnds0 = VEC_alloc (tree, heap, 1);
-  if (op_type == binary_op)
-    vec_oprnds1 = VEC_alloc (tree, heap, 1);
+  if (slp_node && op_type == binary_op)
+    vec_oprnds1 = VEC_alloc (tree, heap, slp_node->vec_stmts_size);
+  else
+    {
+      vec_oprnds0 = VEC_alloc (tree, heap, 1);
+      if (op_type == binary_op)
+        vec_oprnds1 = VEC_alloc (tree, heap, 1);
+    }

   /* In case the vectorization factor (VF) is bigger than the number
      of elements that we can fit in a vectype (nunits), we have to generate
@@ -3993,6 +3997,11 @@ vectorizable_operation (tree stmt, block
                    fprintf (vect_dump, "operand 1 using scalar mode.");
                  vec_oprnd1 = op1;
                  VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
+                  if (slp_node)
+                    {
+                       for (i = 0; i < slp_node->vec_stmts_size - 1; i++)
+                          VEC_quick_push (tree, vec_oprnds1, vec_oprnd1);
+                    }
                }
            }


-- 


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (7 preceding siblings ...)
  2007-10-31 12:58 ` irar at il dot ibm dot com
@ 2007-11-05  3:11 ` mmitchel at gcc dot gnu dot org
  2007-11-06 13:17 ` irar at il dot ibm dot com
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-11-05  3:11 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (8 preceding siblings ...)
  2007-11-05  3:11 ` mmitchel at gcc dot gnu dot org
@ 2007-11-06 13:17 ` irar at il dot ibm dot com
  2007-11-12  9:32 ` irar at gcc dot gnu dot org
  2007-11-12 11:15 ` jakub at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: irar at il dot ibm dot com @ 2007-11-06 13:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from irar at il dot ibm dot com  2007-11-06 13:17 -------
(In reply to comment #6)
> (In reply to comment #2)
> > For example vect_get_vec_defs_for_stmt_copy
> > doesn't allocate the VECs which is exactly what causes the problem here.
> 
> vect_get_vec_defs_for_stmt_copy is not called here, it is used to create vector
> copies in case of multiple types in the loop. It should reuse the VEC used for
> the first copy. I think, there is indeed a problem here. We should overwrite
> the  existing entries and not push the new ones. I'll look into this. 

I thought that there is a problem, because I missed the first pop there. I
think this function is O.K.

Ira


-- 


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (9 preceding siblings ...)
  2007-11-06 13:17 ` irar at il dot ibm dot com
@ 2007-11-12  9:32 ` irar at gcc dot gnu dot org
  2007-11-12 11:15 ` jakub at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: irar at gcc dot gnu dot org @ 2007-11-12  9:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from irar at gcc dot gnu dot org  2007-11-12 09:32 -------
Subject: Bug 33953

Author: irar
Date: Mon Nov 12 09:32:13 2007
New Revision: 130096

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130096
Log:
        PR tree-optimization/33953
        * tree-vect-transform.c (vectorizable_operation): In case of SLP,
        allocate vec_oprnds1 according to the number of created vector
        statements. In case of shift with scalar argument, store scalar operand
        for every vector statement to be created for the SLP node. Fix a
        comment.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr33953.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-transform.c


-- 


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


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

* [Bug tree-optimization/33953] [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017
  2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
                   ` (10 preceding siblings ...)
  2007-11-12  9:32 ` irar at gcc dot gnu dot org
@ 2007-11-12 11:15 ` jakub at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-12 11:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2007-11-12 11:15 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-11-12 11:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-31  0:40 [Bug rtl-optimization/33953] New: [4.3 regression] internal compiler error: vector VEC(tree,base) index domain error, in vectorizable_operation at tree-vect-transform.c:4017 bero at arklinux dot org
2007-10-31  0:42 ` [Bug rtl-optimization/33953] " bero at arklinux dot org
2007-10-31  0:49 ` [Bug tree-optimization/33953] " pinskia at gcc dot gnu dot org
2007-10-31  9:47 ` rguenth at gcc dot gnu dot org
2007-10-31 10:31 ` ubizjak at gmail dot com
2007-10-31 10:37 ` rguenth at gcc dot gnu dot org
2007-10-31 10:57 ` irar at il dot ibm dot com
2007-10-31 11:22 ` irar at il dot ibm dot com
2007-10-31 12:58 ` irar at il dot ibm dot com
2007-11-05  3:11 ` mmitchel at gcc dot gnu dot org
2007-11-06 13:17 ` irar at il dot ibm dot com
2007-11-12  9:32 ` irar at gcc dot gnu dot org
2007-11-12 11:15 ` jakub at gcc dot gnu dot org

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