public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/33860]  New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
@ 2007-10-22 14:10 tbm at cyrius dot com
  2007-10-22 14:11 ` [Bug tree-optimization/33860] " tbm at cyrius dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tbm at cyrius dot com @ 2007-10-22 14:10 UTC (permalink / raw)
  To: gcc-bugs

With current trunk:

(sid)30237:tbm@em64t: ~] /usr/lib/gcc-snapshot/bin/g++ -c -O2 -ftree-vectorize
ppracer-matrix.cc
ppracer-matrix.cc: In member function 'void Matrix::makeRotationAboutVector()':
ppracer-matrix.cc:10: internal compiler error: in vectorizable_load, at
tree-vect-transform.c:5503
Please submit a full bug report,
with preprocessed source if appropriate.

This also happens with trunk from 2007-09-16, but not with 2007-09-02.


-- 
           Summary: [4.3 Regression] ICE in vectorizable_load, at tree-vect-
                    transform.c:5503
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
@ 2007-10-22 14:11 ` tbm at cyrius dot com
  2007-10-22 14:12 ` tbm at cyrius dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tbm at cyrius dot com @ 2007-10-22 14:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tbm at cyrius dot com  2007-10-22 14:11 -------
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */

class Matrix
{
  public:
    double data[4][4];
    Matrix operator* (const Matrix matrix) const;
    void makeRotationAboutVector (void);
};
void Matrix::makeRotationAboutVector (void)
{
   Matrix irx;
   *this = irx * (*this);
}
Matrix Matrix::operator* (const Matrix matrix) const
{
  Matrix ret;
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4; j++)
      ret.data[j][i] = matrix.data[j][2] + matrix.data[j][3];
  return ret;
}


-- 


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
  2007-10-22 14:11 ` [Bug tree-optimization/33860] " tbm at cyrius dot com
@ 2007-10-22 14:12 ` tbm at cyrius dot com
  2007-10-22 14:13 ` tbm at cyrius dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tbm at cyrius dot com @ 2007-10-22 14:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tbm at cyrius dot com  2007-10-22 14:12 -------
Breakpoint 1, fancy_abort (file=0xd7bb78 "gcc/tree-vect-transform.c",
    line=5503, function=0xd7d000 "vectorizable_load") at gcc/diagnostic.c:659
659     {
(gdb) where
#0  fancy_abort (file=0xd7bb78 "gcc/tree-vect-transform.c", line=5503,
    function=0xd7d000 "vectorizable_load") at gcc/diagnostic.c:659
#1  0x0000000000bc149b in vectorizable_load (stmt=0x2b48329082d0, bsi=0x0,
vec_stmt=0x0,
    slp_node=0x0) at gcc/tree-vect-transform.c:5503
#2  0x0000000000ba4488 in vect_analyze_operations (loop_vinfo=0x11304f0)
    at gcc/tree-vect-analyze.c:484
#3  0x0000000000bac0db in vect_analyze_loop (loop=<value optimized out>)
    at gcc/tree-vect-analyze.c:4341
#4  0x0000000000934ae0 in vectorize_loops () at gcc/tree-vectorizer.c:2501
#5  0x0000000000765847 in execute_one_pass (pass=0x101ce20)
    at gcc/passes.c:1117
#6  0x0000000000765a0c in execute_pass_list (pass=0x101ce20)
    at gcc/passes.c:1170
#7  0x0000000000765a1e in execute_pass_list (pass=0x101cc40)
    at gcc/passes.c:1171
#8  0x0000000000765a1e in execute_pass_list (pass=0x101c040)
    at gcc/passes.c:1171
#9  0x0000000000840c1e in tree_rest_of_compilation (fndecl=0x2b48328f0b00)
    at gcc/tree-optimize.c:404
#10 0x00000000009c3bc2 in cgraph_expand_function (node=0x2b48328ff300)
    at gcc/cgraphunit.c:1060
#11 0x00000000009c5668 in cgraph_optimize () at gcc/cgraphunit.c:1123
#12 0x00000000004ac2cf in cp_write_global_declarations ()
    at gcc/cp/decl2.c:3410
#13 0x00000000007e3ec7 in toplev_main (argc=<value optimized out>, argv=<value
optimized out>)
    at gcc/toplev.c:1055
#14 0x00002b483244cb44 in __libc_start_main () from /lib/libc.so.6
#15 0x00000000004043f9 in _start ()
(gdb)


-- 


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
  2007-10-22 14:11 ` [Bug tree-optimization/33860] " tbm at cyrius dot com
  2007-10-22 14:12 ` tbm at cyrius dot com
@ 2007-10-22 14:13 ` tbm at cyrius dot com
  2007-10-22 22:54 ` dorit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tbm at cyrius dot com @ 2007-10-22 14:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tbm at cyrius dot com  2007-10-22 14:12 -------
Created an attachment (id=14388)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14388&action=view)
preprocessed source


-- 


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  2007-10-22 14:13 ` tbm at cyrius dot com
@ 2007-10-22 22:54 ` dorit at gcc dot gnu dot org
  2007-10-23 19:50 ` dorit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dorit at gcc dot gnu dot org @ 2007-10-22 22:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dorit at gcc dot gnu dot org  2007-10-22 22:54 -------
There's some bad interaction here between the data-interleaving support and the
outer-loop support - these are not yet supported together, however it still
slipped through the checks during the analysis phase. This patch fixes that by
not allowing us to detect interleaved accesses in the inner-loop during
outer-loop vectorization:

--- tree-vect-analyze.c 2007-10-22 08:34:45.000000000 +0200
+++ tree-vect-analyze.dn.c      2007-10-22 22:23:01.000000000 +0200
@@ -2321,6 +2321,10 @@

   if (nested_in_vect_loop_p (loop, stmt))
     {
+      /* Interleaved accesses are not yet supported within outer-loop
+        vectorization for references in the inner-loop.  */
+      DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL_TREE;
+
       /* For the rest of the analysis we use the outer-loop step.  */
       step = STMT_VINFO_DR_STEP (stmt_info);
       dr_step = TREE_INT_CST_LOW (step);

(yet to be bootstrapped etc.)

By the way, on powerpc-linux, this testcase gets vectorized with this fix
(after changing the doubles to floats, and forcing alignment of the data array
with attribute aligned), without taking advantage of the fact that the two
loads are interleaved. 

By the way, I suspect that the vectorized code here is quite worse than the
original scalar code;
instead of: (ld,ld,add,store) * 16
we have: (vload,realign,splat,vload,realign,splat,vadd,vstore) * 4
with additional overhead outside the loop.
After the ICE is fixed we should probably add this as a missed-optimization PR
(both in terms of the cost model, and in terms of exploiting the data reuse of
the interleaved accesses).


-- 

dorit at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dorit at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-22 22:54:32
               date|                            |


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  2007-10-22 22:54 ` dorit at gcc dot gnu dot org
@ 2007-10-23 19:50 ` dorit at gcc dot gnu dot org
  2007-11-13  8:27 ` tbm at cyrius dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dorit at gcc dot gnu dot org @ 2007-10-23 19:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dorit at gcc dot gnu dot org  2007-10-23 19:50 -------
Subject: Bug 33860

Author: dorit
Date: Tue Oct 23 19:50:18 2007
New Revision: 129587

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129587
Log:
        PR tree-optimization/33860
        * tree-vect-transform.c (vect_analyze_data_ref_access): Don't allow
        interleaved accesses in case the dr is inside the inner-loop during
        outer-loop vectorization.


Added:
    trunk/gcc/testsuite/g++.dg/vect/pr33860.cc
    trunk/gcc/testsuite/g++.dg/vect/pr33860a.cc
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-analyze.c


-- 


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  2007-10-23 19:50 ` dorit at gcc dot gnu dot org
@ 2007-11-13  8:27 ` tbm at cyrius dot com
  2007-11-13 13:29 ` dorit at gcc dot gnu dot org
  2007-12-02 23:23 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: tbm at cyrius dot com @ 2007-11-13  8:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tbm at cyrius dot com  2007-11-13 08:27 -------
So I guess this can be closed?


-- 

tbm at cyrius dot com changed:

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


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
                   ` (5 preceding siblings ...)
  2007-11-13  8:27 ` tbm at cyrius dot com
@ 2007-11-13 13:29 ` dorit at gcc dot gnu dot org
  2007-12-02 23:23 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: dorit at gcc dot gnu dot org @ 2007-11-13 13:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dorit at gcc dot gnu dot org  2007-11-13 13:29 -------
fixed


-- 

dorit at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/33860] [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503
  2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
                   ` (6 preceding siblings ...)
  2007-11-13 13:29 ` dorit at gcc dot gnu dot org
@ 2007-12-02 23:23 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-02 23:23 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-22 14:10 [Bug tree-optimization/33860] New: [4.3 Regression] ICE in vectorizable_load, at tree-vect-transform.c:5503 tbm at cyrius dot com
2007-10-22 14:11 ` [Bug tree-optimization/33860] " tbm at cyrius dot com
2007-10-22 14:12 ` tbm at cyrius dot com
2007-10-22 14:13 ` tbm at cyrius dot com
2007-10-22 22:54 ` dorit at gcc dot gnu dot org
2007-10-23 19:50 ` dorit at gcc dot gnu dot org
2007-11-13  8:27 ` tbm at cyrius dot com
2007-11-13 13:29 ` dorit at gcc dot gnu dot org
2007-12-02 23:23 ` pinskia 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).