* expr.c (expr): Assert on rankarg, not rank which can be unsigned.
	* read.c (read_a_source_file): Remove buffer_limit[-1] assertion.
	Don't skip over NUL char.
	(pseudo_set): Set X_op for registers to O_register.
	* symbols.c (symbol_clone): Remove assertion that sym is defined.
	(resolve_symbol_value): Resolve O_register symbols.
	* config/tc-i386.c (parse_real_register): Don't use i386_float_regtab.
	Instead find st(0) by hash lookup.
	* config/tc-ppc.c (ppc_macro): Warning fix.
opcodes/
	* i386-opc.c (i386_float_regtab, i386_float_regtab_size): Delete.
	Move contents to..
	(i386_regtab): ..here.
	* i386-opc.h (i386_float_regtab, i386_float_regtab_size): Delete.
This commit is contained in:
Alan Modra 2007-04-21 06:54:57 +00:00
parent c43a438d5e
commit db55703487
9 changed files with 31 additions and 23 deletions

View file

@ -1,5 +1,15 @@
2007-04-21 Alan Modra <amodra@bigpond.net.au>
* expr.c (expr): Assert on rankarg, not rank which can be unsigned.
* read.c (read_a_source_file): Remove buffer_limit[-1] assertion.
Don't skip over NUL char.
(pseudo_set): Set X_op for registers to O_register.
* symbols.c (symbol_clone): Remove assertion that sym is defined.
(resolve_symbol_value): Resolve O_register symbols.
* config/tc-i386.c (parse_real_register): Don't use i386_float_regtab.
Instead find st(0) by hash lookup.
* config/tc-ppc.c (ppc_macro): Warning fix.
* as.h (ENABLE_CHECKING): Default define to 0.
(know): Assert if ENABLE_CHECKING.
(struct relax_type): Remove superfluous declaration.

View file

@ -5804,14 +5804,16 @@ parse_real_register (char *reg_string, char **end_op)
++s;
if (*s >= '0' && *s <= '7')
{
r = &i386_float_regtab[*s - '0'];
int fpr = *s - '0';
++s;
if (is_space_char (*s))
++s;
if (*s == ')')
{
*end_op = s + 1;
return r;
r = hash_find (reg_hash, "st(0)");
know (r);
return r + fpr;
}
}
/* We have "%st(" then garbage. */

View file

@ -2816,7 +2816,7 @@ ppc_macro (str, macro)
char *s;
unsigned int len;
const char *format;
int arg;
unsigned int arg;
char *send;
char *complete;
@ -2854,7 +2854,7 @@ ppc_macro (str, macro)
else
{
arg = strtol (format + 1, &send, 10);
know (send != format && arg >= 0 && arg < count);
know (send != format && arg < count);
len += strlen (operands[arg]);
format = send;
}

View file

@ -1,6 +1,6 @@
/* expr.c -operands, expressions-
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -1636,7 +1636,7 @@ expr (int rankarg, /* Larger # is higher rank. */
operatorT op_right;
int op_chars;
know (rank >= 0);
know (rankarg >= 0);
/* Save the value of dot for the fixup code. */
if (rank == 0)

View file

@ -607,8 +607,6 @@ read_a_source_file (char *name)
last_eol = NULL;
#endif
know (buffer_limit[-1] == '\n'); /* Must have a sentinel. */
while (input_line_pointer < buffer_limit)
{
/* We have more of this buffer to parse. */
@ -705,8 +703,7 @@ read_a_source_file (char *name)
If you must pass stuff, please pass a tree!) */
if ((c = *input_line_pointer++) == '\t'
|| c == ' '
|| c == '\f'
|| c == 0)
|| c == '\f')
c = *input_line_pointer++;
know (c != ' '); /* No further leading whitespace. */
@ -3491,6 +3488,7 @@ pseudo_set (symbolS *symbolP)
S_SET_SEGMENT (symbolP, reg_section);
S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
set_zero_frag (symbolP);
symbol_get_value_expression (symbolP)->X_op = O_register;
break;
case O_symbol:

View file

@ -1,6 +1,6 @@
/* symbols.c -symbol table-
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -563,8 +563,6 @@ symbol_clone (symbolS *orgsymP, int replace)
orgsymP = local_symbol_convert ((struct local_symbol *) orgsymP);
bsymorg = orgsymP->bsym;
know (S_IS_DEFINED (orgsymP));
newsymP = obstack_alloc (&notes, sizeof (*newsymP));
*newsymP = *orgsymP;
bsymnew = bfd_make_empty_symbol (bfd_asymbol_bfd (bsymorg));
@ -1123,6 +1121,9 @@ resolve_symbol_value (symbolS *symp)
final_val += symp->sy_frag->fr_address / OCTETS_PER_BYTE;
if (final_seg == expr_section)
final_seg = absolute_section;
/* Fall through. */
case O_register:
resolved = 1;
break;
@ -1400,7 +1401,6 @@ resolve_symbol_value (symbolS *symp)
&& symbol_resolved_p (op_symbol));
break;
case O_register:
case O_big:
case O_illegal:
/* Give an error (below) if not in expr_section. We don't

View file

@ -1,5 +1,10 @@
2007-04-21 Alan Modra <amodra@bigpond.net.au>
* i386-opc.c (i386_float_regtab, i386_float_regtab_size): Delete.
Move contents to..
(i386_regtab): ..here.
* i386-opc.h (i386_float_regtab, i386_float_regtab_size): Delete.
* ppc-opc.c (powerpc_operands): Delete duplicate entries.
(BA_MASK, FXM_MASK, STRM_MASK, VA_MASK, VB_MASK, VC_MASK): Delete.
(VD_MASK, WS_MASK, MTMSRD_L, XRT_L): Delete.

View file

@ -1712,12 +1712,7 @@ const reg_entry i386_regtab[] =
/* No type will make this register rejected for all purposes except
for addressing. This saves creating one extra type for RIP. */
{"rip", BaseIndex, 0, 0},
};
const unsigned int i386_regtab_size = ARRAY_SIZE (i386_regtab);
const reg_entry i386_float_regtab[] =
{
/* fp regs. */
{"st(0)", FloatReg|FloatAcc, 0, 0},
{"st(1)", FloatReg, 0, 1},
{"st(2)", FloatReg, 0, 2},
@ -1728,7 +1723,7 @@ const reg_entry i386_float_regtab[] =
{"st(7)", FloatReg, 0, 7}
};
const unsigned int i386_float_regtab_size = ARRAY_SIZE (i386_float_regtab);
const unsigned int i386_regtab_size = ARRAY_SIZE (i386_regtab);
/* Segment stuff. */
const seg_entry cs = { "cs", 0x2e };

View file

@ -223,8 +223,6 @@ reg_entry;
extern const reg_entry i386_regtab[];
extern const unsigned int i386_regtab_size;
extern const reg_entry i386_float_regtab[];
extern const unsigned int i386_float_regtab_size;
typedef struct
{