public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
       [not found] <bug-45199-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-30 23:29 ` spop at gcc dot gnu.org
  2010-12-02 16:53 ` spop at gcc dot gnu.org
  2010-12-02 16:57 ` spop at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: spop at gcc dot gnu.org @ 2010-11-30 23:29 UTC (permalink / raw)
  To: gcc-bugs

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

Sebastian Pop <spop at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Sebastian Pop <spop at gcc dot gnu.org> 2010-11-30 23:08:20 UTC ---
The fix for this one is to disable a heuristic that aggregates writes to the
same array into a same partition:

diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 007c4f3..2c2af2c 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -781,8 +781,9 @@ build_rdg_partition_for_component (struct graph *rdg, rdgc
c,
      and determine those vertices that have some memory affinity with
      the current nodes in the component: these are stores to the same
      arrays, i.e. we're taking care of cache locality.  */
-  rdg_flag_similar_memory_accesses (rdg, partition, loops, processed,
-                    other_stores);
+  if (!flag_tree_loop_distribute_patterns)
+    rdg_flag_similar_memory_accesses (rdg, partition, loops, processed,
+                      other_stores);

   rdg_flag_loop_exits (rdg, loops, partition, processed, part_has_writes);


With this patch on the testcase of this PR I get the following code generated:

    # .MEM_54 = VDEF <.MEM_62(D)>
    __builtin_memset (&i_otyp, 0, 4000);
    # .MEM_2 = VDEF <.MEM_54>
    __builtin_memset (&i_styp, 0, 4000);
    # .MEM_78 = VDEF <.MEM_2>
    __builtin_memset (&l_numob, 0, 4000);
    # .MEM_82 = VDEF <.MEM_78>
    __builtin_memset (&i_otyp[1000], 0, 4000);
    # .MEM_83 = VDEF <.MEM_82>
    __builtin_memset (&i_styp[1000], 0, 4000);
    # .MEM_89 = VDEF <.MEM_83>
    __builtin_memset (&l_numob[1000], 0, 4000);
    # .MEM_95 = VDEF <.MEM_89>
    __builtin_memset (&i_otyp[2000], 0, 4000);
    # .MEM_103 = VDEF <.MEM_95>
    __builtin_memset (&i_styp[2000], 0, 4000);
    # .MEM_104 = VDEF <.MEM_103>
    __builtin_memset (&l_numob[2000], 0, 4000);

Note that, for example, i_otyp is written several times, and all these writes
end up in the same loop partition with the heuristic, disabling even the
memset (0) pattern recognition.


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

* [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
       [not found] <bug-45199-4@http.gcc.gnu.org/bugzilla/>
  2010-11-30 23:29 ` [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3 spop at gcc dot gnu.org
@ 2010-12-02 16:53 ` spop at gcc dot gnu.org
  2010-12-02 16:57 ` spop at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: spop at gcc dot gnu.org @ 2010-12-02 16:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sebastian Pop <spop at gcc dot gnu.org> 2010-12-02 16:53:21 UTC ---
Author: spop
Date: Thu Dec  2 16:53:16 2010
New Revision: 167380

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167380
Log:
Fix PR45199: do not aggregate memory accesses to the same array for
-ftree-loop-distribute-patterns

2010-11-30  Sebastian Pop  <sebastian.pop@amd.com>

    PR tree-optimization/45199
    * tree-data-ref.c (mem_write_stride_of_same_size_as_unit_type_p): New.
    (stores_zero_from_loop): Call
    mem_write_stride_of_same_size_as_unit_type_p.
    * tree-data-ref.h (stride_of_unit_type_p): New.
    * tree-loop-distribution.c (generate_memset_zero): Simplified.
    Call stride_of_unit_type_p.
    (build_rdg_partition_for_component): Do not call
    rdg_flag_similar_memory_accesses when
    flag_tree_loop_distribute_patterns is set.

    * gcc.dg/tree-ssa/ldist-15.c: New.
    * gcc.dg/tree-ssa/ldist-16.c: New.
    * gfortran.dg/ldist-pr45199.f: New.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-15.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-16.c
    trunk/gcc/testsuite/gfortran.dg/ldist-pr45199.f
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-data-ref.c
    trunk/gcc/tree-data-ref.h
    trunk/gcc/tree-loop-distribution.c


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

* [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
       [not found] <bug-45199-4@http.gcc.gnu.org/bugzilla/>
  2010-11-30 23:29 ` [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3 spop at gcc dot gnu.org
  2010-12-02 16:53 ` spop at gcc dot gnu.org
@ 2010-12-02 16:57 ` spop at gcc dot gnu.org
  2 siblings, 0 replies; 5+ messages in thread
From: spop at gcc dot gnu.org @ 2010-12-02 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

Sebastian Pop <spop at gcc dot gnu.org> changed:

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

--- Comment #6 from Sebastian Pop <spop at gcc dot gnu.org> 2010-12-02 16:57:01 UTC ---
Fixed


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

* [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
  2010-08-05 20:20 [Bug tree-optimization/45199] New: ICE in loop distribution spop at gcc dot gnu dot org
  2010-08-06 11:11 ` [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3 rguenth at gcc dot gnu dot org
@ 2010-09-02 11:15 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 11:15 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
  2010-08-05 20:20 [Bug tree-optimization/45199] New: ICE in loop distribution spop at gcc dot gnu dot org
@ 2010-08-06 11:11 ` rguenth at gcc dot gnu dot org
  2010-09-02 11:15 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-08-06 11:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-08-06 11:11 -------
Confirmed.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000b6a1e4 in gimple_bb (g=0x0)
    at /space/rguenther/src/svn/trunk/gcc/gimple.h:1148
1148      return g->gsbase.bb;
(gdb) up
#1  0x0000000000b6af64 in find_uses_to_rename_use (bb=0x7ffff5b010d0, 
    use=0x7ffff5aeb058, use_blocks=0x1868620, need_phis=0x186ada8)
    at /space/rguenther/src/svn/trunk/gcc/tree-ssa-loop-manip.c:247
247       def_bb = gimple_bb (SSA_NAME_DEF_STMT (use));
(gdb) p use
$1 = (tree) 0x7ffff5aeb058
(gdb) call debug_tree ($1)
 <ssa_name 0x7ffff5aeb058 nothrow var <var_decl 0x7ffff5ad9dc0 D.1597>def_stmt 

    version 7 in-free-list>


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-08-06 11:11:19
               date|                            |
            Summary|ICE in loop distribution    |[4.6 Regression] ICE in loop
                   |                            |distribution at -O3
   Target Milestone|---                         |4.6.0


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


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45199-4@http.gcc.gnu.org/bugzilla/>
2010-11-30 23:29 ` [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3 spop at gcc dot gnu.org
2010-12-02 16:53 ` spop at gcc dot gnu.org
2010-12-02 16:57 ` spop at gcc dot gnu.org
2010-08-05 20:20 [Bug tree-optimization/45199] New: ICE in loop distribution spop at gcc dot gnu dot org
2010-08-06 11:11 ` [Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3 rguenth at gcc dot gnu dot org
2010-09-02 11:15 ` rguenth 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).