public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug tree-optimization/45199] New: ICE in loop distribution @ 2010-08-05 20:20 spop at gcc dot gnu dot org 2010-08-05 21:11 ` [Bug tree-optimization/45199] " dominiq at lps dot ens dot fr ` (3 more replies) 0 siblings, 4 replies; 8+ messages in thread From: spop at gcc dot gnu dot org @ 2010-08-05 20:20 UTC (permalink / raw) To: gcc-bugs When compiled with -O3 the following code ICEs on amd64-linux. parameter(numlev=3,numoblev=1000) integer i_otyp(numoblev,numlev), i_styp(numoblev,numlev) logical l_numob(numoblev,numlev) do ixe=1,numoblev do iye=1,numlev i_otyp(ixe,iye)=0 i_styp(ixe,iye)=0 l_numob(ixe,iye)=.false. enddo enddo do i=1,m do j=1,n if (l_numob(i,j)) then write(20,'(7I4,F12.2,4F16.10)') i_otyp(i,j),i_styp(i,j) endif enddo enddo end -- Summary: ICE in loop distribution Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: spop at gcc dot gnu dot org ReportedBy: spop at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45199 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/45199] ICE in loop distribution 2010-08-05 20:20 [Bug tree-optimization/45199] New: ICE in loop distribution spop at gcc dot gnu dot org @ 2010-08-05 21:11 ` dominiq at lps dot ens dot fr 2010-08-05 21:40 ` dominiq at lps dot ens dot fr ` (2 subsequent siblings) 3 siblings, 0 replies; 8+ messages in thread From: dominiq at lps dot ens dot fr @ 2010-08-05 21:11 UTC (permalink / raw) To: gcc-bugs ------- Comment #1 from dominiq at lps dot ens dot fr 2010-08-05 21:11 ------- Confirmed on x86_64-apple-darwin10 (for both -m32 and -m64) and the code compiles with -O2 -ftree-vectorize. Revision 162490 is OK. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45199 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug tree-optimization/45199] ICE in loop distribution 2010-08-05 20:20 [Bug tree-optimization/45199] New: ICE in loop distribution spop at gcc dot gnu dot org 2010-08-05 21:11 ` [Bug tree-optimization/45199] " dominiq at lps dot ens dot fr @ 2010-08-05 21:40 ` dominiq at lps dot ens dot fr 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 3 siblings, 0 replies; 8+ messages in thread From: dominiq at lps dot ens dot fr @ 2010-08-05 21:40 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from dominiq at lps dot ens dot fr 2010-08-05 21:40 ------- Backtrace #0 find_uses_to_rename_use (bb=0x141f28138, use=0x141f13058, use_blocks=<value temporarily unavailable, due to optimizations>, need_phis=<value temporarily unavailable, due to optimizations>) at ../../work/gcc/tree-ssa-loop-manip.c:1242 #1 0x0000000100780838 in find_uses_to_rename_bb (bb=<value temporarily unavailable, due to optimizations>, use_blocks=0x141923730, need_phis=0x142081b68) at ../../work/gcc/tree-ssa-loop-manip.c:284 #2 0x0000000100780f0e in rewrite_into_loop_closed_ssa (changed_bbs=<value temporarily unavailable, due to optimizations>, update_flag=<value temporarily unavailable, due to optimizations>) at ../../work/gcc/tree-ssa-loop-manip.c:331 #3 0x00000001006f0131 in distribute_loop (loop=0x7fff5fbfd550, stmts=<value temporarily unavailable, due to optimizations>) at ../../work/gcc/tree-loop-distribution.c:1094 #4 0x00000001006f160f in tree_loop_distribution () at ../../work/gcc/tree-loop-distribution.c:1215 #5 0x00000001005d1e46 in execute_one_pass (pass=0x100cdb420) at ../../work/gcc/passes.c:1564 #6 0x00000001005d211d in execute_pass_list (pass=0x100cdb420) at ../../work/gcc/passes.c:1619 #7 0x00000001005d212f in execute_pass_list (pass=0x100cdc5e0) at ../../work/gcc/passes.c:1620 #8 0x00000001005d212f in execute_pass_list (pass=0x100cdb7e0) at ../../work/gcc/passes.c:1620 #9 0x00000001007017ac in tree_rest_of_compilation (fndecl=0x141efc900) at ../../work/gcc/tree-optimize.c:452 #10 0x00000001008d038d in cgraph_expand_function (node=0x141f03000) at ../../work/gcc/cgraphunit.c:1643 #11 0x00000001008d363a in cgraph_optimize () at ../../work/gcc/cgraphunit.c:1722 #12 0x00000001008d3cca in cgraph_finalize_compilation_unit () at ../../work/gcc/cgraphunit.c:1185 #13 0x000000010055f506 in write_global_declarations () at ../../work/gcc/langhooks.c:310 #14 0x000000010069358e in toplev_main (argc=3, argv=0x7fff5fbfd9c8) at ../../work/gcc/toplev.c:983 #15 0x00000001000017e4 in start () -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45199 ^ permalink raw reply [flat|nested] 8+ 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-05 21:11 ` [Bug tree-optimization/45199] " dominiq at lps dot ens dot fr 2010-08-05 21:40 ` dominiq at lps dot ens dot fr @ 2010-08-06 11:11 ` rguenth at gcc dot gnu dot org 2010-09-02 11:15 ` rguenth at gcc dot gnu dot org 3 siblings, 0 replies; 8+ 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] 8+ 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 ` (2 preceding siblings ...) 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 3 siblings, 0 replies; 8+ 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] 8+ messages in thread
[parent not found: <bug-45199-4@http.gcc.gnu.org/bugzilla/>]
* [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; 8+ 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] 8+ 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 ` 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; 8+ 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] 8+ 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 ` 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; 8+ 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] 8+ messages in thread
end of thread, other threads:[~2010-12-02 16:57 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-08-05 20:20 [Bug tree-optimization/45199] New: ICE in loop distribution spop at gcc dot gnu dot org 2010-08-05 21:11 ` [Bug tree-optimization/45199] " dominiq at lps dot ens dot fr 2010-08-05 21:40 ` dominiq at lps dot ens dot fr 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 [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
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).