mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 23:23:09 +00:00
PR 33214 sparc LDM/STM/LDMA/STMA etc. FAIL on Solaris/SPARC
Delete code in compare_opcodes preferencing 1+i over i+1 and 1,i over i,1. Instead simply make the sort stable, by keeping the original table order.
This commit is contained in:
@@ -387,40 +387,12 @@ compare_opcodes (const void * a, const void * b)
|
|||||||
return length_diff;
|
return length_diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put 1+i before i+1. */
|
/* They are, as far as we can tell, identical. Keep the order in
|
||||||
{
|
the sparc_opcodes table. */
|
||||||
char *p0 = (char *) strchr (op0->args, '+');
|
if (op0 < op1)
|
||||||
char *p1 = (char *) strchr (op1->args, '+');
|
return -1;
|
||||||
|
if (op0 > op1)
|
||||||
if (p0 && p1)
|
return 1;
|
||||||
{
|
|
||||||
/* There is a plus in both operands. Note that a plus
|
|
||||||
sign cannot be the first character in args,
|
|
||||||
so the following [-1]'s are valid. */
|
|
||||||
if (p0[-1] == 'i' && p1[1] == 'i')
|
|
||||||
/* op0 is i+1 and op1 is 1+i, so op1 goes first. */
|
|
||||||
return 1;
|
|
||||||
if (p0[1] == 'i' && p1[-1] == 'i')
|
|
||||||
/* op0 is 1+i and op1 is i+1, so op0 goes first. */
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Put 1,i before i,1. */
|
|
||||||
{
|
|
||||||
int i0 = strncmp (op0->args, "i,1", 3) == 0;
|
|
||||||
int i1 = strncmp (op1->args, "i,1", 3) == 0;
|
|
||||||
|
|
||||||
if (i0 ^ i1)
|
|
||||||
return i0 - i1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* They are, as far as we can tell, identical.
|
|
||||||
Since qsort may have rearranged the table partially, there is
|
|
||||||
no way to tell which one was first in the opcode table as
|
|
||||||
written, so just say there are equal. */
|
|
||||||
/* ??? This is no longer true now that we sort a vector of pointers,
|
|
||||||
not the table itself. */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user