re PR target/79487 (Invalid _Decimal32 comparison on s390x)

PR target/79487
	* real.c (real_from_integer): Call real_convert even for decimal.

	* gcc.dg/dfp/pr79487.c: New test.
	* c-c++-common/ubsan/float-cast-overflow-8.c (TEST): Revert
	2017-02-13 change.

From-SVN: r245477
This commit is contained in:
Jakub Jelinek 2017-02-15 13:19:53 +01:00 committed by Jakub Jelinek
parent a0003c78ac
commit fa8db6eaf2
5 changed files with 31 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2017-02-15 Jakub Jelinek <jakub@redhat.com>
PR target/79487
* real.c (real_from_integer): Call real_convert even for decimal.
2017-02-15 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79421

View File

@ -2266,7 +2266,7 @@ real_from_integer (REAL_VALUE_TYPE *r, format_helper fmt,
if (fmt.decimal_p ())
decimal_from_integer (r);
else if (fmt)
if (fmt)
real_convert (r, fmt, r);
}

View File

@ -1,3 +1,10 @@
2017-02-15 Jakub Jelinek <jakub@redhat.com>
PR target/79487
* gcc.dg/dfp/pr79487.c: New test.
* c-c++-common/ubsan/float-cast-overflow-8.c (TEST): Revert
2017-02-13 change.
2017-01-14 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/vsx-builtin-3.c: Add missing test case for the

View File

@ -8,7 +8,7 @@
#define TEST(type1, type2) \
if (type1##_MIN) \
{ \
volatile type2 min = type1##_MIN; \
type2 min = type1##_MIN; \
type2 add = -1.0; \
while (1) \
{ \
@ -28,7 +28,7 @@
volatile type1 tem3 = cvt_##type1##_##type2 (-1.0f); \
} \
{ \
volatile type2 max = type1##_MAX; \
type2 max = type1##_MAX; \
type2 add = 1.0; \
while (1) \
{ \

View File

@ -0,0 +1,16 @@
/* PR target/79487 */
/* { dg-options "-O2" } */
int
main ()
{
_Decimal32 a = (-9223372036854775807LL - 1LL);
_Decimal32 b = -9.223372E+18DF;
if (b - a != 0.0DF)
__builtin_abort ();
_Decimal64 c = (-9223372036854775807LL - 1LL);
_Decimal64 d = -9.223372036854776E+18DD;
if (d - c != 0.0DD)
__builtin_abort ();
return 0;
}