mirror of git://gcc.gnu.org/git/gcc.git
AVR: target/122220 - Let (int32_t) -0x1p31L return INT32_MIN.
PR target/122220 libgcc/config/avr/libf7/ * libf7-asm.sx (to_integer): Return 0x80... on negative overflow. gcc/testsuite/ * gcc.target/avr/pr122220.c: New test.
This commit is contained in:
parent
310a70ef6d
commit
3ea09e4d43
|
@ -0,0 +1,23 @@
|
|||
/* { dg-do run { target { ! avr_tiny } } } */
|
||||
/* { dg-additional-options { -std=gnu99 -Os -mcall-prologues } } */
|
||||
|
||||
#if __SIZEOF_LONG_DOUBLE__ == 8
|
||||
|
||||
typedef long double D;
|
||||
typedef __INT32_TYPE__ int32_t;
|
||||
|
||||
D dd = -0x1p31L;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
if ((int32_t) dd != -0x7fffffff - 1)
|
||||
__builtin_abort();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int main (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
|
@ -618,21 +618,7 @@ DEFUN to_integer
|
|||
.Lsaturate.T:
|
||||
|
||||
#if F7_HAVE_Inf
|
||||
brtc .Lset_0x7fff
|
||||
;; -Inf => return 1 + INTxx_MIN
|
||||
mov ZL, Flags
|
||||
.global __clr_8
|
||||
XCALL __clr_8
|
||||
ldi C6, 0x80
|
||||
|
||||
ldi CA+0, 0x01
|
||||
|
||||
sbrs Mask, 5
|
||||
ldi CA+4, 0x01
|
||||
|
||||
sbrs Mask, 4
|
||||
ldi CA+6, 0x01
|
||||
ret
|
||||
brts .Lset_0x8000
|
||||
|
||||
.Lset_0x7fff:
|
||||
;; +Inf => return INTxx_MAX
|
||||
|
@ -644,7 +630,7 @@ DEFUN to_integer
|
|||
#endif /* F7_HAVE_Inf */
|
||||
|
||||
.Lset_0x8000:
|
||||
;; NaN => return INTxx_MIN
|
||||
;; NaN or -Inf => return INTxx_MIN
|
||||
.global __clr_8
|
||||
XCALL __clr_8
|
||||
ldi C6, 0x80
|
||||
|
|
Loading…
Reference in New Issue