mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-30 00:52:16 +08:00
Fix PR 1889, infinite loop compiling code with bad user template.
* config/tc-ia64.c (emit_one_bundle): Perform last_slot < 0 check even when manual_bundling isn't set.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2005-11-22 James E Wilson <wilson@specifix.com>
|
||||||
|
|
||||||
|
* config/tc-ia64.c (emit_one_bundle): Perform last_slot < 0 check
|
||||||
|
even when manual_bundling isn't set.
|
||||||
|
|
||||||
2005-11-18 Jie Zhang <jie.zhang@analog.com>
|
2005-11-18 Jie Zhang <jie.zhang@analog.com>
|
||||||
|
|
||||||
* config/bfin-defs.h (IS_BREG, IS_LREG): New macros.
|
* config/bfin-defs.h (IS_BREG, IS_LREG): New macros.
|
||||||
|
@ -7084,25 +7084,28 @@ emit_one_bundle ()
|
|||||||
curr = (curr + 1) % NUM_SLOTS;
|
curr = (curr + 1) % NUM_SLOTS;
|
||||||
idesc = md.slot[curr].idesc;
|
idesc = md.slot[curr].idesc;
|
||||||
}
|
}
|
||||||
if (manual_bundling > 0)
|
|
||||||
|
/* A user template was specified, but the first following instruction did
|
||||||
|
not fit. This can happen with or without manual bundling. */
|
||||||
|
if (md.num_slots_in_use > 0 && last_slot < 0)
|
||||||
|
{
|
||||||
|
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
|
||||||
|
"`%s' does not fit into %s template",
|
||||||
|
idesc->name, ia64_templ_desc[template].name);
|
||||||
|
/* Drop first insn so we don't livelock. */
|
||||||
|
--md.num_slots_in_use;
|
||||||
|
know (curr == first);
|
||||||
|
ia64_free_opcode (md.slot[curr].idesc);
|
||||||
|
memset (md.slot + curr, 0, sizeof (md.slot[curr]));
|
||||||
|
md.slot[curr].user_template = -1;
|
||||||
|
}
|
||||||
|
else if (manual_bundling > 0)
|
||||||
{
|
{
|
||||||
if (md.num_slots_in_use > 0)
|
if (md.num_slots_in_use > 0)
|
||||||
{
|
{
|
||||||
if (last_slot >= 2)
|
if (last_slot >= 2)
|
||||||
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
|
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
|
||||||
"`%s' does not fit into bundle", idesc->name);
|
"`%s' does not fit into bundle", idesc->name);
|
||||||
else if (last_slot < 0)
|
|
||||||
{
|
|
||||||
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
|
|
||||||
"`%s' does not fit into %s template",
|
|
||||||
idesc->name, ia64_templ_desc[template].name);
|
|
||||||
/* Drop first insn so we don't livelock. */
|
|
||||||
--md.num_slots_in_use;
|
|
||||||
know (curr == first);
|
|
||||||
ia64_free_opcode (md.slot[curr].idesc);
|
|
||||||
memset (md.slot + curr, 0, sizeof (md.slot[curr]));
|
|
||||||
md.slot[curr].user_template = -1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const char *where;
|
const char *where;
|
||||||
@ -7122,6 +7125,7 @@ emit_one_bundle ()
|
|||||||
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
|
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
|
||||||
"Missing '}' at end of file");
|
"Missing '}' at end of file");
|
||||||
}
|
}
|
||||||
|
|
||||||
know (md.num_slots_in_use < NUM_SLOTS);
|
know (md.num_slots_in_use < NUM_SLOTS);
|
||||||
|
|
||||||
t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46);
|
t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46);
|
||||||
|
Reference in New Issue
Block a user