This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] D10V - Add gas warning for uses of reserved control regs
- To: binutils at sources dot redhat dot com
- Subject: [PATCH] D10V - Add gas warning for uses of reserved control regs
- From: Jason Eckhardt <jle at cygnus dot com>
- Date: Tue, 24 Apr 2001 06:53:14 -0700 (PDT)
2000-04-24 Jason Eckhardt <jle@redhat.com>
* config/tc-d10v.c (find_opcode): Emit a warning if one of the
reserved control registers is used.
Index: tc-d10v.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/config/tc-d10v.c,v
retrieving revision 1.61.4.11
diff -c -3 -p -r1.61.4.11 tc-d10v.c
*** tc-d10v.c 2001/02/02 18:42:17 1.61.4.11
--- tc-d10v.c 2001/04/18 18:54:40
*************** find_opcode (opcode, myops)
*** 1608,1613 ****
--- 1608,1615 ----
/* Check that all registers that are required to be even are. */
/* Also, if any operands were marked as registers, but were really symbols */
/* fix that here. */
+ /* Also emit a warning if any of the reserved control registers were
+ used. The reserved CRs are CR4-6, CR12, CR13 and CR15. */
for (i=0; opcode->operands[i]; i++)
{
if ((d10v_operands[opcode->operands[i]].flags & OPERAND_EVEN) &&
*************** find_opcode (opcode, myops)
*** 1623,1628 ****
--- 1625,1639 ----
myops[i].X_op_symbol = NULL;
}
}
+ if ((d10v_operands[opcode->operands[i]].flags & OPERAND_CONTROL)
+ && (myops[i].X_add_number == OPERAND_CONTROL + 4
+ || myops[i].X_add_number == OPERAND_CONTROL + 5
+ || myops[i].X_add_number == OPERAND_CONTROL + 6
+ || myops[i].X_add_number == OPERAND_CONTROL + 12
+ || myops[i].X_add_number == OPERAND_CONTROL + 13
+ || myops[i].X_add_number == OPERAND_CONTROL + 15))
+ as_warn (_("cr%d is a reserved control register"),
+ myops[i].X_add_number - OPERAND_CONTROL);
}
return opcode;
}