[gcc]
2017-11-27 Michael Meissner <meissner@linux.vnet.ibm.com> PR middle_end/82333 * varasm.c (compare_constant): Take the mode of the constants into account when comparing floating point constants. [gcc/testsuite] 2017-11-27 Michael Meissner <meissner@linux.vnet.ibm.com> PR middle_end/82333 * gcc.target/powerpc/pr82333.c: New test. From-SVN: r255177
This commit is contained in:
parent
0f42ffd7f7
commit
32c95bcae3
@ -1,3 +1,9 @@
|
||||
2017-11-27 Michael Meissner <meissner@linux.vnet.ibm.com>
|
||||
|
||||
PR middle_end/82333
|
||||
* varasm.c (compare_constant): Take the mode of the constants into
|
||||
account when comparing floating point constants.
|
||||
|
||||
2017-11-27 Gerald Pfeifer <gerald@pfeifer.com>
|
||||
|
||||
* hash-set.h (DEFINE_DEBUG_HASH_SET): Remove static qualifier
|
||||
|
@ -1,3 +1,8 @@
|
||||
2017-11-27 Michael Meissner <meissner@linux.vnet.ibm.com>
|
||||
|
||||
PR middle_end/82333
|
||||
* gcc.target/powerpc/pr82333.c: New test.
|
||||
|
||||
2017-11-27 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/81675
|
||||
|
34
gcc/testsuite/gcc.target/powerpc/pr82333.c
Normal file
34
gcc/testsuite/gcc.target/powerpc/pr82333.c
Normal file
@ -0,0 +1,34 @@
|
||||
/* { dg-do compile { target { powerpc*-*-linux* } } } */
|
||||
/* { dg-require-effective-target ppc_float128_sw } */
|
||||
/* { dg-require-effective-target vsx_hw } */
|
||||
/* { dg-options "-mvsx -O2 -mabi=ibmlongdouble -Wno-psabi" } */
|
||||
|
||||
/* PR 82333 was an internal compiler abort where the compiler thought that a
|
||||
long double _Complex constant was the same as __float128 _Complex. */
|
||||
|
||||
_Complex long double vld;
|
||||
_Complex _Float128 vf128;
|
||||
|
||||
_Complex long double
|
||||
fld (_Complex long double arg0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
_Complex _Float128
|
||||
ff128 (_Complex _Float128 arg0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
tld (void)
|
||||
{
|
||||
vld = fld (vld);
|
||||
}
|
||||
|
||||
void
|
||||
tf128 (void)
|
||||
{
|
||||
vf128 = ff128 (vf128);
|
||||
}
|
10
gcc/varasm.c
10
gcc/varasm.c
@ -3118,10 +3118,16 @@ compare_constant (const tree t1, const tree t2)
|
||||
return tree_int_cst_equal (t1, t2);
|
||||
|
||||
case REAL_CST:
|
||||
/* Real constants are the same only if the same width of type. */
|
||||
/* Real constants are the same only if the same width of type. In
|
||||
addition to the same width, we need to check whether the modes are the
|
||||
same. There might be two floating point modes that are the same size
|
||||
but have different representations, such as the PowerPC that has 2
|
||||
different 128-bit floating point types (IBM extended double and IEEE
|
||||
128-bit floating point). */
|
||||
if (TYPE_PRECISION (TREE_TYPE (t1)) != TYPE_PRECISION (TREE_TYPE (t2)))
|
||||
return 0;
|
||||
|
||||
if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2)))
|
||||
return 0;
|
||||
return real_identical (&TREE_REAL_CST (t1), &TREE_REAL_CST (t2));
|
||||
|
||||
case FIXED_CST:
|
||||
|
Loading…
Reference in New Issue
Block a user