Created attachment 5810 [details] Test case extracted from kernel code. A minimal test case extracted from the kernel code is attached as genex.s. Failure sympthom is the following assertion: genex.s: Assembler messages: genex.s:5: Internal error! Assertion failure in append_insn at ../../gas/config/tc-mips.c line 2867. To reproduce: o Using binutils with target mips64-linux, mipsel-linux, mips64el-linux or mips-linux: mips{,64}{,el}-linux-as -mabi=32 -o genex.o genex.s o Using mips-linux or mipsel-linux no -mabi=32 is needed: mips-linux-as -o genex.o genex.s mipsel-linux-as -o genex.o genex.s mips64-linux and mips64el-linux will not trigger the issue without -mabi=32. The destination register being used in the last two lines has to be the same for both lines to trigger the bug, that is $28 here. If both lines to not use the same destination register, as will not throw the assertion.
Thanks for the report. The problem is caused by a thinko in the code that looks for a hazard between the pre-noreorder code and the post-noreorder code.
CVSROOT: /cvs/src Module name: src Changes by: rsandifo@sourceware.org 2011-06-23 20:21:38 Modified files: gas/config : tc-mips.c gas/testsuite/gas/mips: mips.exp gas/testsuite : ChangeLog gas : ChangeLog Added files: gas/testsuite/gas/mips: pr12915.s pr12915.d Log message: gas/ PR gas/12915 * config/tc-mips.c (append_insn): Only consider hazards between the pre-noreorder block and ip. gas/testsuite/ * gas/mips/pr12915.s, gas/mips/pr12915.d: New test. * gas/mips/mips.exp: Run it. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-mips.c.diff?cvsroot=src&r1=1.462&r2=1.463 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/pr12915.s.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/pr12915.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/mips.exp.diff?cvsroot=src&r1=1.184&r2=1.185 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1917&r2=1.1918 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4514&r2=1.4515
Thanks, Richard! I just backported the patch on top of a vanilla binutils 2.21 and the previously failing kernel file now seems to be assembled correctly so I think this bug can now be closed.
CVSROOT: /cvs/src Module name: src Changes by: rsandifo@sourceware.org 2011-06-25 10:11:47 Modified files: gas/config : tc-mips.c gas/testsuite/gas/mips: vr4130.s vr4130.d gas/testsuite : ChangeLog gas : ChangeLog Log message: gas/ PR gas/12915 * config/tc-mips.c (nops_for_vr4130, nops_for_24k, nops_for_insn) (nops_for_sequence, nops_for_insn_or_target): Add ignore parameters. (mips_emit_delays, start_noreorder): Update accordingly. (append_insn): Likewise. Revert original fix for this PR and use the ignore parameter instead. gas/testsuite/ * gas/mips/vr4130.s: Add some more ".set noreorder" tests. * gas/mips/vr4130.d: Update accordingly. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-mips.c.diff?cvsroot=src&r1=1.463&r2=1.464 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/vr4130.s.diff?cvsroot=src&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/vr4130.d.diff?cvsroot=src&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1918&r2=1.1919 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4517&r2=1.4518
Closing old bug that has been resolved in 2.22.