public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47001] New: segmentation fault in vect_mark_slp_stmts
@ 2010-12-18 12:29 dcb314 at hotmail dot com
  2010-12-20  9:00 ` [Bug tree-optimization/47001] " irar at il dot ibm.com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dcb314 at hotmail dot com @ 2010-12-18 12:29 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: segmentation fault in vect_mark_slp_stmts
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dcb314@hotmail.com


Created attachment 22808
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22808
C source code

I just tried to compile package groonga-1.0.3 with the latest 4.6
snapshot 20101211 on a Fedora Linux box. The compiler said

io.c: In function 'grn_io_open':
io.c:402:12: warning: variable 'flags' set but not used
[-Wunused-but-set-variable]
io.c:397:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

valgrind says

==8475== Invalid read of size 4
==8475==    at 0x92FA3D: vect_mark_slp_stmts (tree-vect-slp.c:2597)
==8475==    by 0x932443: vect_make_slp_decision (tree-vect-slp.c:1347)
==8475==    by 0x928F80: vect_analyze_loop (tree-vect-loop.c:1497)
==8475==    by 0x935647: vectorize_loops (tree-vectorizer.c:199)
==8475==    by 0x74510E: execute_one_pass (passes.c:1553)
==8475==    by 0x7453B4: execute_pass_list (passes.c:1608)
==8475==    by 0x7453C6: execute_pass_list (passes.c:1609)
==8475==    by 0x7453C6: execute_pass_list (passes.c:1609)
==8475==    by 0x838CD5: tree_rest_of_compilation (tree-optimize.c:422)
==8475==    by 0x9D6540: cgraph_expand_function (cgraphunit.c:1508)
==8475==    by 0x9D8AA9: cgraph_optimize (cgraphunit.c:1567)
==8475==    by 0x9D9019: cgraph_finalize_compilation_unit (cgraphunit.c:1031)
==8475==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==8475==

Source code attached. Flag -O3 required.


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

* [Bug tree-optimization/47001] segmentation fault in vect_mark_slp_stmts
  2010-12-18 12:29 [Bug c/47001] New: segmentation fault in vect_mark_slp_stmts dcb314 at hotmail dot com
@ 2010-12-20  9:00 ` irar at il dot ibm.com
  2010-12-21 15:42 ` irar at gcc dot gnu.org
  2010-12-23 16:31 ` irar at il dot ibm.com
  2 siblings, 0 replies; 4+ messages in thread
From: irar at il dot ibm.com @ 2010-12-20  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

Ira Rosen <irar at il dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.12.20 09:00:13
                 CC|                            |irar at il dot ibm.com
         AssignedTo|unassigned at gcc dot       |irar at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Ira Rosen <irar at il dot ibm.com> 2010-12-20 09:00:13 UTC ---
The vectorizer tries to do SLP for reduction here, but there is only one scalar
load for both reductions, which is not supported, but also is not checked. I am
testing a patch that adds such check.

Index: tree-vect-slp.c
===================================================================
--- tree-vect-slp.c     (revision 167365)
+++ tree-vect-slp.c     (working copy)
@@ -1002,7 +1002,35 @@ vect_supported_load_permutation_p (slp_i

       if (!bad_permutation)
         {
-          /* This permutaion is valid for reduction.  Since the order of the
+          /* Check that all the loads are different.  */
+          load_index = sbitmap_alloc (group_size);
+          sbitmap_zero (load_index);
+          for (k = 0; k < group_size; k++)
+            {
+              first_group_load_index = VEC_index (int, load_permutation, k);
+              if (TEST_BIT (load_index, first_group_load_index))
+                {
+                  bad_permutation = true;
+                  break;
+                }
+
+              SET_BIT (load_index, first_group_load_index);
+            }
+
+          if (!bad_permutation)
+            for (k = 0; k < group_size; k++)
+              if (!TEST_BIT (load_index, k))
+                {
+                  bad_permutation = true;
+                  break;
+                }
+
+          sbitmap_free (load_index);
+        }
+
+      if (!bad_permutation)
+        {
+          /* This permutation is valid for reduction.  Since the order of the
              statements in the nodes is not important unless they are memory
              accesses, we can rearrange the statements in all the nodes
              according to the order of the loads.  */


Ira


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

* [Bug tree-optimization/47001] segmentation fault in vect_mark_slp_stmts
  2010-12-18 12:29 [Bug c/47001] New: segmentation fault in vect_mark_slp_stmts dcb314 at hotmail dot com
  2010-12-20  9:00 ` [Bug tree-optimization/47001] " irar at il dot ibm.com
@ 2010-12-21 15:42 ` irar at gcc dot gnu.org
  2010-12-23 16:31 ` irar at il dot ibm.com
  2 siblings, 0 replies; 4+ messages in thread
From: irar at gcc dot gnu.org @ 2010-12-21 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from irar at gcc dot gnu.org 2010-12-21 15:42:15 UTC ---
Author: irar
Date: Tue Dec 21 15:42:11 2010
New Revision: 168123

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

        PR tree-optimization/47001
        * tree-vect-slp.c (vect_supported_load_permutation_p): Check
        that the loads in reduction are different and there are no gaps
        between them.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr47001.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-slp.c


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

* [Bug tree-optimization/47001] segmentation fault in vect_mark_slp_stmts
  2010-12-18 12:29 [Bug c/47001] New: segmentation fault in vect_mark_slp_stmts dcb314 at hotmail dot com
  2010-12-20  9:00 ` [Bug tree-optimization/47001] " irar at il dot ibm.com
  2010-12-21 15:42 ` irar at gcc dot gnu.org
@ 2010-12-23 16:31 ` irar at il dot ibm.com
  2 siblings, 0 replies; 4+ messages in thread
From: irar at il dot ibm.com @ 2010-12-23 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

Ira Rosen <irar at il dot ibm.com> changed:

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

--- Comment #3 from Ira Rosen <irar at il dot ibm.com> 2010-12-23 16:31:43 UTC ---
Fixed.


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

end of thread, other threads:[~2010-12-23 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-18 12:29 [Bug c/47001] New: segmentation fault in vect_mark_slp_stmts dcb314 at hotmail dot com
2010-12-20  9:00 ` [Bug tree-optimization/47001] " irar at il dot ibm.com
2010-12-21 15:42 ` irar at gcc dot gnu.org
2010-12-23 16:31 ` irar at il dot ibm.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).