This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Correctly bump line number in bfin gas
- From: "Jie Zhang" <jzhang918 at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 23 May 2006 14:07:26 +0800
- Subject: PATCH: Correctly bump line number in bfin gas
When dealing with Blackfin loop_begin/loop_end instructions,
bfin_start_line_hook () does not bump line number correctly. This
patch fixes it. I have installed it.
Jie
* config/tc-bfin.c (bfin_start_line_hook): Bump line counters
if needed.
Index: config/tc-bfin.c
===================================================================
RCS file: /cvsroot/gcc3/binutils/binutils-2.15/gas/config/tc-bfin.c,v
retrieving revision 1.49
diff -u -p -r1.49 tc-bfin.c
--- config/tc-bfin.c 7 Apr 2006 03:33:38 -0000 1.49
+++ config/tc-bfin.c 1 May 2006 16:26:32 -0000
@@ -886,9 +886,14 @@ bfin_start_line_hook ()
char *c1, *label_name;
symbolS *line_label;
char *c = input_line_pointer;
+ int cr_num = 0;
while (ISSPACE (*c))
- c++;
+ {
+ if (*c == '\n')
+ cr_num++;
+ c++;
+ }
/* Look for Loop_Begin or Loop_End statements. */
@@ -954,6 +959,12 @@ bfin_start_line_hook ()
c1 = c;
while (ISALPHA (*c) || ISDIGIT (*c) || *c == '_') c++;
+ if (input_line_pointer[-1] == '\n')
+ bump_line_counters ();
+
+ while (cr_num--)
+ bump_line_counters ();
+
input_line_pointer = c;
if (maybe_end)
{