* [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels
@ 2010-10-10 7:50 Mike Frysinger
2010-10-10 7:50 ` [PATCH 2/2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns Mike Frysinger
2010-10-11 8:37 ` [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels Mike Frysinger
0 siblings, 2 replies; 5+ messages in thread
From: Mike Frysinger @ 2010-10-10 7:50 UTC (permalink / raw)
To: binutils; +Cc: David Gibson
From: David Gibson <david.gibson@analog.com>
The current LOOP_BEGIN/LOOP_END pseudo insns hit "Internal errors" when
using local labels as the loop names due to attempts at removing them.
Signed-off-by: David Gibson <david.gibson@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-10 David Gibson <david.gibson@analog.com>
* config/tc-bfin.c (bfin_gen_loop): Check symbol before removing.
---
gas/config/tc-bfin.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index ccd14cb..e854dce 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -1874,6 +1874,7 @@ bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
char *lbeginsym, *lendsym;
Expr_Node_Value lbeginval, lendval;
Expr_Node *lbegin, *lend;
+ symbolS *sym;
loopsym = exp->value.s_value;
lbeginsym = (char *) xmalloc (strlen (loopsym) + strlen ("__BEGIN") + 5);
@@ -1896,9 +1897,11 @@ bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
lbegin = Expr_Node_Create (Expr_Node_Reloc, lbeginval, NULL, NULL);
lend = Expr_Node_Create (Expr_Node_Reloc, lendval, NULL, NULL);
- symbol_remove (symbol_find (loopsym), &symbol_rootP, &symbol_lastP);
+ sym = symbol_find(loopsym);
+ if (!S_IS_LOCAL (sym) || (S_IS_LOCAL (sym) && !symbol_used_p (sym)))
+ symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- return bfin_gen_loopsetup(lbegin, reg, rop, lend, preg);
+ return bfin_gen_loopsetup (lbegin, reg, rop, lend, preg);
}
void
--
1.7.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns
2010-10-10 7:50 [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels Mike Frysinger
@ 2010-10-10 7:50 ` Mike Frysinger
2010-10-10 8:56 ` [PATCH 2/2 v2] " Mike Frysinger
2010-10-11 8:37 ` [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels Mike Frysinger
1 sibling, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2010-10-10 7:50 UTC (permalink / raw)
To: binutils; +Cc: David Gibson
From: David Gibson <david.gibson@analog.com>
The current LOOP_BEGIN/LOOP_END pseudo insns hit parser errors when trying
to use numeric local labels. So add support for them.
Signed-off-by: David Gibson <david.gibson@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-10 David Gibson <david.gibson@analog.com>
* config/bfin-aux.h (bfin_loop_attempt_create_label): New prototype.
* config/bfin-parse.y (LOOP_BEGIN, LOOP_END): Handle numeric labels.
* config/tc-bfin.c (bfin_loop_attempt_create_label): New funtion.
---
gas/config/bfin-aux.h | 1 +
gas/config/bfin-parse.y | 22 ++++++++++++++++++++++
gas/config/tc-bfin.c | 9 +++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/gas/config/bfin-aux.h b/gas/config/bfin-aux.h
index 465a6af..e78a4e8 100755
--- a/gas/config/bfin-aux.h
+++ b/gas/config/bfin-aux.h
@@ -56,6 +56,7 @@ INSTR_T bfin_gen_cactrl (REG_T, int, int);
INSTR_T bfin_gen_progctrl (int, int);
INSTR_T bfin_gen_loopsetup (Expr_Node *, REG_T, int, Expr_Node *, REG_T);
INSTR_T bfin_gen_loop (Expr_Node *, REG_T, int, REG_T);
+void bfin_loop_attempt_create_label (Expr_Node *, int);
void bfin_loop_beginend (Expr_Node *, int);
INSTR_T bfin_gen_pushpopmultiple (int, int, int, int, int);
INSTR_T bfin_gen_pushpopreg (REG_T, int);
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index 81640aa..c34e84c 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -3573,6 +3573,17 @@ asm_1:
}
/* LOOP_BEGIN. */
+ | LOOP_BEGIN NUMBER
+ {
+ Expr_Node_Value val;
+ val.i_value = $2;
+ Expr_Node *tmp = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
+ bfin_loop_attempt_create_label (tmp, 1);
+ if (!IS_RELOC (tmp))
+ return yyerror ("Invalid expression in LOOP_BEGIN statement");
+ bfin_loop_beginend (tmp, 1);
+ $$ = 0;
+ }
| LOOP_BEGIN expr
{
if (!IS_RELOC ($2))
@@ -3583,6 +3594,17 @@ asm_1:
}
/* LOOP_END. */
+ | LOOP_END NUMBER
+ {
+ Expr_Node_Value val;
+ val.i_value = $2;
+ Expr_Node *tmp = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
+ bfin_loop_attempt_create_label (tmp, 1);
+ if (!IS_RELOC (tmp))
+ return yyerror ("Invalid expression in LOOP_END statement");
+ bfin_loop_beginend (tmp, 0);
+ $$ = 0;
+ }
| LOOP_END expr
{
if (!IS_RELOC ($2))
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index e854dce..7ecfeea 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -1905,6 +1905,15 @@ bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
}
void
+bfin_loop_attempt_create_label(Expr_Node *expr, int is_begin)
+{
+ char *name;
+ name = fb_label_name (expr->value.i_value, is_begin);
+ expr->value.s_value = xstrdup (name);
+ expr->type = Expr_Node_Reloc;
+}
+
+void
bfin_loop_beginend (Expr_Node *exp, int begin)
{
const char *loopsym;
--
1.7.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2 v2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns
2010-10-10 7:50 ` [PATCH 2/2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns Mike Frysinger
@ 2010-10-10 8:56 ` Mike Frysinger
2010-10-11 8:38 ` Mike Frysinger
0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2010-10-10 8:56 UTC (permalink / raw)
To: binutils; +Cc: David Gibson
From: David Gibson <david.gibson@analog.com>
The current LOOP_BEGIN/LOOP_END pseudo insns hit parser errors when trying
to use numeric local labels. So add support for them.
Signed-off-by: David Gibson <david.gibson@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-09-10 David Gibson <david.gibson@analog.com>
* config/bfin-aux.h (bfin_loop_attempt_create_label): New prototype.
* config/bfin-parse.y (LOOP_BEGIN, LOOP_END): Handle numeric labels.
* config/tc-bfin.c (bfin_loop_attempt_create_label): New funtion.
---
v2
- fix style and shadow warnings
gas/config/bfin-aux.h | 1 +
gas/config/bfin-parse.y | 22 ++++++++++++++++++++++
gas/config/tc-bfin.c | 9 +++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/gas/config/bfin-aux.h b/gas/config/bfin-aux.h
index 465a6af..e78a4e8 100755
--- a/gas/config/bfin-aux.h
+++ b/gas/config/bfin-aux.h
@@ -56,6 +56,7 @@ INSTR_T bfin_gen_cactrl (REG_T, int, int);
INSTR_T bfin_gen_progctrl (int, int);
INSTR_T bfin_gen_loopsetup (Expr_Node *, REG_T, int, Expr_Node *, REG_T);
INSTR_T bfin_gen_loop (Expr_Node *, REG_T, int, REG_T);
+void bfin_loop_attempt_create_label (Expr_Node *, int);
void bfin_loop_beginend (Expr_Node *, int);
INSTR_T bfin_gen_pushpopmultiple (int, int, int, int, int);
INSTR_T bfin_gen_pushpopreg (REG_T, int);
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index 81640aa..c34e84c 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -3573,6 +3573,17 @@ asm_1:
}
/* LOOP_BEGIN. */
+ | LOOP_BEGIN NUMBER
+ {
+ Expr_Node_Value val;
+ val.i_value = $2;
+ Expr_Node *tmp = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
+ bfin_loop_attempt_create_label (tmp, 1);
+ if (!IS_RELOC (tmp))
+ return yyerror ("Invalid expression in LOOP_BEGIN statement");
+ bfin_loop_beginend (tmp, 1);
+ $$ = 0;
+ }
| LOOP_BEGIN expr
{
if (!IS_RELOC ($2))
@@ -3583,6 +3594,17 @@ asm_1:
}
/* LOOP_END. */
+ | LOOP_END NUMBER
+ {
+ Expr_Node_Value val;
+ val.i_value = $2;
+ Expr_Node *tmp = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
+ bfin_loop_attempt_create_label (tmp, 1);
+ if (!IS_RELOC (tmp))
+ return yyerror ("Invalid expression in LOOP_END statement");
+ bfin_loop_beginend (tmp, 0);
+ $$ = 0;
+ }
| LOOP_END expr
{
if (!IS_RELOC ($2))
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index e854dce..3efc4b6 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -1905,6 +1905,15 @@ bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg)
}
void
+bfin_loop_attempt_create_label (Expr_Node *exp, int is_begin)
+{
+ char *name;
+ name = fb_label_name (exp->value.i_value, is_begin);
+ exp->value.s_value = xstrdup (name);
+ exp->type = Expr_Node_Reloc;
+}
+
+void
bfin_loop_beginend (Expr_Node *exp, int begin)
{
const char *loopsym;
--
1.7.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels
2010-10-10 7:50 [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels Mike Frysinger
2010-10-10 7:50 ` [PATCH 2/2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns Mike Frysinger
@ 2010-10-11 8:37 ` Mike Frysinger
1 sibling, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2010-10-11 8:37 UTC (permalink / raw)
To: binutils; +Cc: David Gibson
[-- Attachment #1: Type: Text/Plain, Size: 281 bytes --]
On Sunday, October 10, 2010 03:48:13 Mike Frysinger wrote:
> From: David Gibson <david.gibson@analog.com>
>
> The current LOOP_BEGIN/LOOP_END pseudo insns hit "Internal errors" when
> using local labels as the loop names due to attempts at removing them.
committed
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2 v2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns
2010-10-10 8:56 ` [PATCH 2/2 v2] " Mike Frysinger
@ 2010-10-11 8:38 ` Mike Frysinger
0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2010-10-11 8:38 UTC (permalink / raw)
To: binutils; +Cc: David Gibson
[-- Attachment #1: Type: Text/Plain, Size: 268 bytes --]
On Sunday, October 10, 2010 04:53:59 Mike Frysinger wrote:
> From: David Gibson <david.gibson@analog.com>
>
> The current LOOP_BEGIN/LOOP_END pseudo insns hit parser errors when trying
> to use numeric local labels. So add support for them.
committed
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-10-11 8:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-10 7:50 [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels Mike Frysinger
2010-10-10 7:50 ` [PATCH 2/2] gas: blackfin: support numeric local labels with LOOP_BEGIN/LOOP_END pseudo insns Mike Frysinger
2010-10-10 8:56 ` [PATCH 2/2 v2] " Mike Frysinger
2010-10-11 8:38 ` Mike Frysinger
2010-10-11 8:37 ` [PATCH 1/2] gas: blackfin: fix LOOP_BEGIN/LOOP_END pseudo insns handling of local labels Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).