Do not convert a subtract of zero into an add of zero.
This commit is contained in:
parent
d3427997ad
commit
358b94bdb1
5 changed files with 26 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-05-02 Nick Clifton <nickc@cambridge.redhat.com>
|
||||
|
||||
* config/tc-arm.c (thumb_add_sub): Do not convert a subtract of
|
||||
zero into an add of zero - it is not the same.
|
||||
|
||||
2002-05-01 Arati Dikey <aratid@kpit.com>
|
||||
|
||||
* tc-sh.c (get_specific): Generate warning if the same
|
||||
|
|
|
@ -7433,11 +7433,11 @@ thumb_add_sub (str, subtract)
|
|||
int offset = inst.reloc.exp.X_add_number;
|
||||
|
||||
if (subtract)
|
||||
offset = -offset;
|
||||
offset = - offset;
|
||||
|
||||
if (offset < 0)
|
||||
{
|
||||
offset = -offset;
|
||||
offset = - offset;
|
||||
subtract = 1;
|
||||
|
||||
/* Quick check, in case offset is MIN_INT. */
|
||||
|
@ -7447,7 +7447,9 @@ thumb_add_sub (str, subtract)
|
|||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Note - you cannot convert a subtract of 0 into an
|
||||
add of 0 because the carry flag is set differently. */
|
||||
else if (offset > 0)
|
||||
subtract = 0;
|
||||
|
||||
if (Rd == REG_SP)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2002-05-02 Nick Clifton <nickc@cambridge.redhat.com>
|
||||
|
||||
* gas/arm/arm7t.s: Add thumb mode "sub r?, #0" and "add r?, #0".
|
||||
* gas/arm/arm7t.d: Add expected results. (Make sure that the
|
||||
subtract is not converted into an add).
|
||||
|
||||
2002-04-23 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* gas/mips/elempic.d: Use empic.l.
|
||||
|
|
|
@ -66,3 +66,5 @@ Disassembly of section .text:
|
|||
[ ]*dc:.*fred
|
||||
0+e0 <[^>]*> 0000c0de ? .*
|
||||
0+e4 <[^>]*> 0000dead ? .*
|
||||
0+e8 <[^>]*> 3800 sub r0, #0
|
||||
0+ea <[^>]*> 3000 add r0, #0
|
||||
|
|
|
@ -72,3 +72,11 @@ misc:
|
|||
.align
|
||||
.L2:
|
||||
.word fred
|
||||
|
||||
.ltorg
|
||||
.thumb
|
||||
.global thumb_tests
|
||||
.thumb_func
|
||||
thumb_tests:
|
||||
sub r0, #0
|
||||
add r0, #0
|
||||
|
|
Loading…
Reference in a new issue