* config/tc-sh.c (parse_at): Reject @(r0) and @(r0,).

This commit is contained in:
Alexandre Oliva 2001-12-20 17:28:13 +00:00
parent 2c283bc467
commit 8d4d84c202
2 changed files with 30 additions and 13 deletions

View file

@ -1,3 +1,7 @@
2001-12-20 Alexandre Oliva <aoliva@redhat.com>
* config/tc-sh.c (parse_at): Reject @(r0) and @(r0,).
2001-12-20 matthew green <mrg@redhat.com> 2001-12-20 matthew green <mrg@redhat.com>
* config/tc-ppc.c (md_parse_option): Make -maltivec default * config/tc-ppc.c (md_parse_option): Make -maltivec default

View file

@ -914,7 +914,7 @@ parse_at (src, op)
else if (src[0] == '(') else if (src[0] == '(')
{ {
/* Could be @(disp, rn), @(disp, gbr), @(disp, pc), @(r0, gbr) or /* Could be @(disp, rn), @(disp, gbr), @(disp, pc), @(r0, gbr) or
@(r0, rn) */ @(r0, rn). */
src++; src++;
len = parse_reg (src, &mode, &(op->reg)); len = parse_reg (src, &mode, &(op->reg));
if (len && mode == A_REG_N) if (len && mode == A_REG_N)
@ -925,29 +925,42 @@ parse_at (src, op)
as_bad (_("must be @(r0,...)")); as_bad (_("must be @(r0,...)"));
} }
if (src[0] == ',') if (src[0] == ',')
src++;
/* Now can be rn or gbr */
len = parse_reg (src, &mode, &(op->reg));
if (mode == A_GBR)
{ {
op->type = A_R0_GBR; src++;
} /* Now can be rn or gbr. */
else if (mode == A_REG_N) len = parse_reg (src, &mode, &(op->reg));
{
op->type = A_IND_R0_REG_N;
} }
else else
{ {
as_bad (_("syntax error in @(r0,...)")); len = 0;
}
if (len)
{
if (mode == A_GBR)
{
op->type = A_R0_GBR;
}
else if (mode == A_REG_N)
{
op->type = A_IND_R0_REG_N;
}
else
{
as_bad (_("syntax error in @(r0,...)"));
}
}
else
{
as_bad (_("syntax error in @(r0...)"));
} }
} }
else else
{ {
/* Must be an @(disp,.. thing) */ /* Must be an @(disp,.. thing). */
src = parse_exp (src, op); src = parse_exp (src, op);
if (src[0] == ',') if (src[0] == ',')
src++; src++;
/* Now can be rn, gbr or pc */ /* Now can be rn, gbr or pc. */
len = parse_reg (src, &mode, &op->reg); len = parse_reg (src, &mode, &op->reg);
if (len) if (len)
{ {