aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2014-06-13 03:17:02 +0000
committerThomas Preud'homme <thopre01@gcc.gnu.org>2014-06-13 03:17:02 +0000
commitca6cbdca8a7223e9b7ed828306b09f80db92fdb7 (patch)
tree00dc9bc1a5848830de25e289b8e25e3225dafefb /gcc/tree-ssa-math-opts.c
parent9aa1bac557c40373654ca4c15f3502ecb9b8b951 (diff)
downloadgcc-ca6cbdca8a7223e9b7ed828306b09f80db92fdb7.zip
gcc-ca6cbdca8a7223e9b7ed828306b09f80db92fdb7.tar.gz
gcc-ca6cbdca8a7223e9b7ed828306b09f80db92fdb7.tar.bz2
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
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index c868e92..066548d 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -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);