mirror of git://gcc.gnu.org/git/gcc.git
re PR tree-optimization/61375 (ICE in int_cst_value at -O3 in tree-ssa pass when compiling a reference to an __int128 value)
2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
PR tree-optimization/61375
* tree-ssa-math-opts.c (init_symbolic_number): Cancel optimization if
symbolic number cannot be represented in an uint64_t.
(find_bswap_or_nop_1): Likewise.
gcc/testsuite/
PR tree-optimization/61375
* gcc.c-torture/execute/pr61375-1.c: New test.
From-SVN: r211604
This commit is contained in:
parent
9aa1bac557
commit
ca6cbdca8a
|
|
@ -1,3 +1,10 @@
|
|||
2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||
|
||||
PR tree-optimization/61375
|
||||
* tree-ssa-math-opts.c (init_symbolic_number): Cancel optimization if
|
||||
symbolic number cannot be represented in an uint64_t.
|
||||
(find_bswap_or_nop_1): Likewise.
|
||||
|
||||
2014-06-12 Jan Hubicka <hubicka@ucw.cz>
|
||||
|
||||
* symtab.c (symtab_node::reset_section): New method.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2014-06-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||
|
||||
PR tree-optimization/61375
|
||||
* gcc.c-torture/execute/pr61375-1.c: New test.
|
||||
|
||||
2014-06-12 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/61486
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
#ifdef __UINT64_TYPE__
|
||||
typedef __UINT64_TYPE__ uint64_t;
|
||||
#else
|
||||
typedef unsigned long long uint64_t;
|
||||
#endif
|
||||
|
||||
#ifndef __SIZEOF_INT128__
|
||||
#define __int128 long long
|
||||
#endif
|
||||
|
||||
/* Some version of bswap optimization would ICE when analyzing a mask constant
|
||||
too big for an uint64_t variable (PR210931). */
|
||||
|
||||
__attribute__ ((noinline, noclone)) uint64_t
|
||||
uint128_central_bitsi_ior (unsigned __int128 in1, uint64_t in2)
|
||||
{
|
||||
__int128 mask = (__int128)0xffff << 56;
|
||||
return ((in1 & mask) >> 56) | in2;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc)
|
||||
{
|
||||
__int128 in = 1;
|
||||
#ifdef __SIZEOF_INT128__
|
||||
in <<= 64;
|
||||
#endif
|
||||
if (sizeof (uint64_t) * __CHAR_BIT__ != 64)
|
||||
return 0;
|
||||
if (sizeof (unsigned __int128) * __CHAR_BIT__ != 128)
|
||||
return 0;
|
||||
if (uint128_central_bitsi_ior (in, 2) != 0x102)
|
||||
__builtin_abort ();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1725,6 +1725,8 @@ init_symbolic_number (struct symbolic_number *n, tree src)
|
|||
if (size % BITS_PER_UNIT != 0)
|
||||
return false;
|
||||
size /= BITS_PER_UNIT;
|
||||
if (size > (int)sizeof (uint64_t))
|
||||
return false;
|
||||
n->range = size;
|
||||
n->n = CMPNOP;
|
||||
|
||||
|
|
@ -1894,6 +1896,8 @@ find_bswap_or_nop_1 (gimple stmt, struct symbolic_number *n, int limit)
|
|||
type_size = TYPE_PRECISION (type);
|
||||
if (type_size % BITS_PER_UNIT != 0)
|
||||
return NULL_TREE;
|
||||
if (type_size > (int)sizeof (uint64_t) * 8)
|
||||
return NULL_TREE;
|
||||
|
||||
/* Sign extension: result is dependent on the value. */
|
||||
old_type_size = TYPE_PRECISION (n->type);
|
||||
|
|
|
|||
Loading…
Reference in New Issue