aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-04-07 16:34:06 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-04-07 16:34:06 +0200
commitdcc72b9e73852d9e3b5f40c6dc51da12c444d699 (patch)
treef42a807458e5c2d2ddd09d1038d0bf44d207f68c /gcc/expr.c
parent440f9408ea950a29ef7606b6114d84d1a5b53c90 (diff)
downloadgcc-dcc72b9e73852d9e3b5f40c6dc51da12c444d699.zip
gcc-dcc72b9e73852d9e3b5f40c6dc51da12c444d699.tar.gz
gcc-dcc72b9e73852d9e3b5f40c6dc51da12c444d699.tar.bz2
re PR middle-end/65680 (ICE at -O1 and above on x86_64-linux-gnu in expand_assignment, at expr.c:4830)
PR middle-end/65680 * expr.c (get_inner_reference): Handle bit_offset that doesn't fit into signed HOST_WIDE_INT the same as negative bit_offset. * gcc.c-torture/compile/pr65680.c: New test. From-SVN: r221899
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index dc13a14..5c09550 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -6941,7 +6941,7 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
if (offset)
{
/* Avoid returning a negative bitpos as this may wreak havoc later. */
- if (wi::neg_p (bit_offset))
+ if (wi::neg_p (bit_offset) || !wi::fits_shwi_p (bit_offset))
{
offset_int mask = wi::mask <offset_int> (LOG2_BITS_PER_UNIT, false);
offset_int tem = bit_offset.and_not (mask);