I get the following ICE with 4.2.0 20061116 with -fprefetch-loop-arrays: tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/g++ -c -O3 libjingle0.3-xmppclient.cpp tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/g++ -c -O -fprefetch-loop-arrays libjingle0.3-xmppclient.cpp libjingle0.3-xmppclient.cpp: In member function 'virtual buzz::SaslMechanism* buzz::PlainSaslHandler::CreateSaslMechanism(const std::string&)': libjingle0.3-xmppclient.cpp:231: internal compiler error: in coalesce_abnormal_edges, at tree-outof-ssa.c:644 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. tbm@coconut0:~$
Created attachment 12648 [details] testcase
Reduced testcase: int length1(); int g(int); void f(int capacity_, char *old_storage) { try { length1(); int old_capacity = capacity_; capacity_ *= 2; g(capacity_); for (int i = 1; i < old_capacity; i++) old_storage[i] = old_storage[i - 1]; } catch (...) { for (int i = 1; i < capacity_; i++){} } }
I think after remove empty loops, we should add a DCE pass which should fix the above reduced testcase but will not fix this reduced testcase: int length1(); int g(int); void f(int capacity_, char*old_storage) { try { length1(); int old_capacity = capacity_; capacity_ *= 2; g(capacity_); for (int i = 1; i < old_capacity; i++) old_storage[i] = old_storage[i - 1]; } catch (...) { for (int i = 1; i < capacity_; i++){old_storage[i] = 0;} } }
On what target is this? I cannot reproduce it neither on i686 nor from ppc crosscompiler.
I could reproduce this with -march=pentium4 -fprefetch-loop-arrays with "4.3.0 20061111" for 4.2.0, you might need --enable-checking.
(In reply to comment #4) > On what target is this? I cannot reproduce it neither on i686 nor from ppc > crosscompiler. I was on ia64.
Subject: Bug 29902 Author: rakdver Date: Tue Nov 21 23:45:21 2006 New Revision: 119074 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119074 Log: PR tree-optimization/29902 * tree-ssa-loop-manip.c (can_unroll_loop_p): Return false if any involved ssa name appears in abnormal phi node. * g++.dg/tree-ssa/pr29902.C: New test. Added: trunk/gcc/testsuite/g++.dg/tree-ssa/pr29902.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-loop-manip.c
Fixed on the trunk.
Zdenek -- Can this patch be backported to 4.2? Thanks, -- Mark
Subject: Bug 29902 Author: rakdver Date: Sat Mar 3 00:38:56 2007 New Revision: 122501 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122501 Log: PR tree-optimization/29902 * tree-ssa-loop-manip.c (can_unroll_loop_p): Return false if any involved ssa name appears in abnormal phi node. * g++.dg/tree-ssa/pr29902.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/tree-ssa/pr29902.C Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/gcc/tree-ssa-loop-manip.c
> Can this patch be backported to 4.2? Done.