See https://wwws.clamav.net/bugzilla/show_bug.cgi?id=2190 $ g++-4.5 -fprefetch-loop-arrays TargetLowering.ii -c -O2 ../../../../clamav-devel/libclamav/c++/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp: In member function ‘void llvm::TargetLowering::computeRegisterProperties()’: ../../../../clamav-devel/libclamav/c++/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:608:6: internal compiler error: in verify_expr, at tree-cfg.c:2541 Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions. g++-4.4 works: $ g++-4.4 -fprefetch-loop-arrays TargetLowering.ii -c -O2 $ g++-4.5 -v Using built-in specs. COLLECT_GCC=/usr/bin/g++-4.5 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.1-1' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --program-suffix=-4.5 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --with-plugin-ld=ld.gold --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.5.1 (Debian 4.5.1-1)
Created attachment 21457 [details] TargetLowering.ii
It was caused by revision 153878: http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00094.html and disappeared with revision 159514: http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00566.html I am not if it really fixed the bug.
(In reply to comment #2) > It was caused by revision 153878: > > http://gcc.gnu.org/ml/gcc-cvs/2009-11/msg00094.html > I think the same patch was also committed to 4.4 branch. Maybe some prefetch work(s) in 4.5 triggered the bug. > and disappeared with revision 159514: > > http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00566.html > > I am not if it really fixed the bug. > This could not be a valid fix, because it just disable some prefetches based on performance concern.
This bug should be related to VIEW_CONVERT_EXPR. If I use the following statement to filter the prefetch, the bug will go away: if (contains_view_convert_expr_p (ref)) return false; Otherwise, the prefetch pass will generate "ref + offset" as the prefetching address.
I have a fix: http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01625.html
Committed to trunk as Revision: 163475: http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00688.html Committed to 4.5 branch as Revision: 163483 http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00696.html
Fixed. Changpeng, please remember to add PR tree-optimization/45260 to commit messages (well, paste aggregated changelog entries there).