Bug 13024 - Internal error on mips/mipsel
Summary: Internal error on mips/mipsel
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: rsandifo@nildram.co.uk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-24 21:00 UTC by Aurelien Jarno
Modified: 2013-06-14 13:24 UTC (History)
1 user (show)

See Also:
Host: mips-unknown-linux-gnu
Target: mips-unknown-linux-gnu
Build: mips-unknown-linux-gnu
Last reconfirmed:


Attachments
T (210.61 KB, application/x-gzip)
2011-07-24 21:00 UTC, Aurelien Jarno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Jarno 2011-07-24 21:00:39 UTC
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.
Comment 1 rsandifo@nildram.co.uk 2011-09-03 13:00:44 UTC
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
Comment 2 Sourceware Commits 2011-09-05 19:19:05 UTC
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
Comment 3 rsandifo@nildram.co.uk 2011-09-05 19:48:39 UTC
Fixed in trunk.
Comment 4 Aurelien Jarno 2011-09-08 14:24:32 UTC
I confirm this fixes the issue, thanks a lot for working on that.
Comment 5 Sourceware Commits 2013-06-14 13:24:43 UTC
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