aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-01-26 15:09:29 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-01-26 15:09:29 +0100
commit892123df86260d2bddfc9bbb9f2d60915a5b0b8d (patch)
tree4ef0a42b783ea90511e4b9dc646b1386093ba1cd /gcc/expr.c
parent1a47f99c0f033b16594eaabac4e6dbc4c5c58554 (diff)
downloadgcc-892123df86260d2bddfc9bbb9f2d60915a5b0b8d.zip
gcc-892123df86260d2bddfc9bbb9f2d60915a5b0b8d.tar.gz
gcc-892123df86260d2bddfc9bbb9f2d60915a5b0b8d.tar.bz2
re PR middle-end/51895 (ICE in simplify_subreg)
PR middle-end/51895 * expr.c (expand_expr_real_1): Handle BLKmode MEM_REF of non-addressable non-BLKmode base correctly. * g++.dg/opt/pr51895.C: New test. From-SVN: r183560
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index bd2f6b1..8698f18 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9327,6 +9327,16 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
bftype = TREE_TYPE (base);
if (TYPE_MODE (TREE_TYPE (exp)) != BLKmode)
bftype = TREE_TYPE (exp);
+ else
+ {
+ temp = assign_stack_temp (DECL_MODE (base),
+ GET_MODE_SIZE (DECL_MODE (base)),
+ 0);
+ store_expr (base, temp, 0, false);
+ temp = adjust_address (temp, BLKmode, offset);
+ set_mem_size (temp, int_size_in_bytes (TREE_TYPE (exp)));
+ return temp;
+ }
return expand_expr (build3 (BIT_FIELD_REF, bftype,
base,
TYPE_SIZE (TREE_TYPE (exp)),