Created attachment 5861 [details] T Recent changes to gas (20110629 is ok, 20110707 is not), makes it unable to compile certain files: testcase.s: Assembler messages: testcase.s: Internal error! Assertion failure in emit_inc_line_addr at dwarf2dbg.c line 926. Please report this bug. I have attached a testcase to reproduce the issue, but while the bug appears on both mips and mipsel, it seems the testcase itself is endianness specific.
Confirmed. This was caused by the patch to adjust location information when swapping branches. It only works for the last .loc: if there are two consecutive .locs, the first is generated at the original address. A reduced testcase is: .file 1 "foo.c" .cfi_startproc .ent foo .type foo, @function foo: .loc 1 1 0 move $2,$4 .loc 1 2 0 .loc 1 3 0 j $31 .end foo .cfi_endproc
CVSROOT: /cvs/src Module name: src Changes by: rsandifo@sourceware.org 2011-09-05 19:19:01 Modified files: gas : dwarf2dbg.c ChangeLog gas/testsuite/gas/mips: mips.exp gas/testsuite : ChangeLog Added files: gas/testsuite/gas/mips: loc-swap-2.s loc-swap-2.d micromips@loc-swap-2.d mips16@loc-swap-2.d Log message: gas/ PR gas/13024 * dwarf2dbg.c (pending_lines, pending_lines_tail): New variables. (dwarf2_gen_line_info_1): Delete. (dwarf2_push_line, dwarf2_flush_pending_lines): New functions. (dwarf2_gen_line_info, dwarf2_emit_label): Use them. (dwarf2_consume_line_info): Call dwarf2_flush_pending_lines. (dwarf2_directive_loc): Push previous .locs instead of generating them immediately. gas/testsuite/ * gas/mips/loc-swap-2.s, gas/mips/loc-swap-2.d, gas/mips/micromips@loc-swap-2.d, gas/mips/mips16@loc-swap-2.d: New test. * gas/mips/mips.exp: Run it. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/dwarf2dbg.c.diff?cvsroot=src&r1=1.112&r2=1.113 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4575&r2=1.4576 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/loc-swap-2.s.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/loc-swap-2.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/micromips@loc-swap-2.d.diff?cvsroot=src&r1=NONE&r2=1.1 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/mips/mips16@loc-swap-2.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.191&r2=1.192 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1945&r2=1.1946
Fixed in trunk.
I confirm this fixes the issue, thanks a lot for working on that.
CVSROOT: /cvs/src Module name: src Changes by: rsandifo@sourceware.org 2013-06-14 13:24:41 Modified files: gas : dwarf2dbg.c ChangeLog Log message: gas/ Revert: 2011-09-05 Richard Sandiford <rdsandiford@googlemail.com> PR gas/13024 * dwarf2dbg.c (pending_lines, pending_lines_tail): New variables. (dwarf2_gen_line_info_1): Delete. (dwarf2_push_line, dwarf2_flush_pending_lines): New functions. (dwarf2_gen_line_info, dwarf2_emit_label): Use them. (dwarf2_consume_line_info): Call dwarf2_flush_pending_lines. (dwarf2_directive_loc): Push previous .locs instead of generating them immediately. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/dwarf2dbg.c.diff?cvsroot=src&r1=1.119&r2=1.120 http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.5008&r2=1.5009