[Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
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=gccview=revrev=167380 Log: Fix PR45199: do not aggregate memory accesses to the same array for -ftree-loop-distribute-patterns 2010-11-30 Sebastian Pop sebastian@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
[Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
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
[Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
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.
[Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
-- rguenth at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45199
[Bug tree-optimization/45199] [4.6 Regression] ICE in loop distribution at -O3
--- Comment #3 from rguenth at gcc dot gnu dot org 2010-08-06 11:11 --- Confirmed. Program received signal SIGSEGV, Segmentation fault. 0x00b6a1e4 in gimple_bb (g=0x0) at /space/rguenther/src/svn/trunk/gcc/gimple.h:1148 1148 return g-gsbase.bb; (gdb) up #1 0x00b6af64 in find_uses_to_rename_use (bb=0x75b010d0, use=0x75aeb058, 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) 0x75aeb058 (gdb) call debug_tree ($1) ssa_name 0x75aeb058 nothrow var var_decl 0x75ad9dc0 D.1597def_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|-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