Created attachment 27636 [details] preprocessed source We encounter an ICE on ia64 when building Allegro 4.4 on Debian unstable with gcc-4.6 4.6.3-6. It builds fine on all other architectures. Here is the command line and output, the preprocessed source is attached. | [ 1%] Building C object CMakeFiles/allegro.dir/src/c/cgfx15.c.o | /usr/bin/gcc -Dallegro_EXPORTS -g -O2 -Wformat -Werror=format-security -W -Wall -Wno-unused-parameter -Wdeclaration-after-statement -O3 -DNDEBUG -fPIC -I/home/kibi/allegro4.4-4.4.2/include -I/home/kibi/allegro4.4-4.4.2/build/include -isystem /usr/include/alsa -DALLEGRO_SRC -DALLEGRO_MODULES_PATH='"/usr/lib/ia64-linux-gnu/allegro/4.4.2"' -o CMakeFiles/allegro.dir/src/c/cgfx15.c.o -c /home/kibi/allegro4.4-4.4.2/src/c/cgfx15.c | In file included from /home/kibi/allegro4.4-4.4.2/src/c/cgfx15.c:25:0: | /home/kibi/allegro4.4-4.4.2/src/c/cgfx.h: In function '_linear_hline15': | /home/kibi/allegro4.4-4.4.2/src/c/cgfx.h:217:1: internal compiler error: in find_used_regs, at sel-sched.c:3273 | Please submit a full bug report, | with preprocessed source if appropriate. | See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions. | Preprocessed source stored into /tmp/ccFa4uiC.out file, please attach this to your bugreport.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672142
FWIW, it builds fine with: gcc-4.7 (Debian 4.7.1-1) 4.7.0
ICEs gcc 4.6.3 and 4.4.7, compiles w/o error with 4.7.1, 4.5.3, 4.3.6, and 4.2.4 (all crosses to ia64-linux hosted on i686-linux).
This was fixed for gcc-4.7.0 by r177658: http://gcc.gnu.org/ml/gcc-cvs/2011-08/msg00672.html http://gcc.gnu.org/ml/gcc-patches/2011-08/msg00353.html The patch applies cleanly to 4.6.3 and cures the ICE on this test case. I haven't tested the backport beyond that. For 4.6.3 you can also avoid the ICE by reducing the optimization level to -O2.
Unfortunately r177658 seems to be the cause of wrong-code PR53975.
The trunk (with PR53975 fixed and thus the old patch reverted) ICEs in av_set_could_be_blocked_by_bookkeeping_p, I will take a look.
Created attachment 27959 [details] proposed patch The problem is that when checking expressions that are blocked for movement because of recently created bookkeeping code we need to consider also all old forms of those expressions as they could get transformed on the way up. PR53975 just uncovers this bug but is actually unrelated. The attached patch fixes the testcase but is not yet otherwise tested.
Author: abel Date: Thu Aug 9 14:08:31 2012 New Revision: 190253 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190253 Log: PR rtl-optimization/53701 * sel-sched.c (vinsn_vec_has_expr_p): Clarify function comment. Process not only expr's vinsns but all old vinsns from expr's history of changes. (update_and_record_unavailable_insns): Clarify comment. * gcc.dg/pr53701.c: New test. Added: trunk/gcc/testsuite/gcc.dg/pr53701.c Modified: trunk/gcc/ChangeLog trunk/gcc/sel-sched.c trunk/gcc/testsuite/ChangeLog
Author: abel Date: Tue Oct 16 13:22:22 2012 New Revision: 192498 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192498 Log: 2012-10-16 Andrey Belevantsev <abel@ispras.ru> Backport from mainline 2012-08-09 Andrey Belevantsev <abel@ispras.ru> PR rtl-optimization/53701 * sel-sched.c (vinsn_vec_has_expr_p): Clarify function comment. Process not only expr's vinsns but all old vinsns from expr's history of changes. (update_and_record_unavailable_insns): Clarify comment. testsuite: 2012-10-16 Andrey Belevantsev <abel@ispras.ru> Backport from mainline 2012-08-09 Andrey Belevantsev <abel@ispras.ru> PR rtl-optimization/53701 * gcc.dg/pr53701.c: New test. Added: branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/pr53701.c Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/sel-sched.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Author: abel Date: Mon Oct 22 19:34:35 2012 New Revision: 192693 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192693 Log: Backport from mainline 2012-08-09 Andrey Belevantsev <abel@ispras.ru> PR rtl-optimization/53701 * sel-sched.c (vinsn_vec_has_expr_p): Clarify function comment. Process not only expr's vinsns but all old vinsns from expr's history of changes. * gcc.dg/pr53701.c: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/pr53701.c Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/sel-sched.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed.