Do not convert a subtract of zero into an add of zero.

This commit is contained in:
Nick Clifton 2002-05-02 09:11:14 +00:00
parent d3427997ad
commit 358b94bdb1
5 changed files with 26 additions and 3 deletions

View file

@ -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

View file

@ -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)

View file

@ -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.

View file

@ -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

View file

@ -72,3 +72,11 @@ misc:
.align
.L2:
.word fred
.ltorg
.thumb
.global thumb_tests
.thumb_func
thumb_tests:
sub r0, #0
add r0, #0