diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-10-12 09:23:24 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-10-12 09:23:24 +0200 |
commit | 6089393b7401123b37e4e59a6853c0c196c423c5 (patch) | |
tree | b7e456f1cc40bd8b1c31a95b0bc707d690c99e52 /gcc/expr.c | |
parent | 281ff779cc1efadd5004248e7de6ef3cfc8c30df (diff) | |
download | gcc-6089393b7401123b37e4e59a6853c0c196c423c5.zip gcc-6089393b7401123b37e4e59a6853c0c196c423c5.tar.gz gcc-6089393b7401123b37e4e59a6853c0c196c423c5.tar.bz2 |
re PR c++/82159 (ICE: in assign_temp, at function.c:961)
PR c++/82159
* expr.c (store_field): Don't optimize away bitsize == 0 store
from CALL_EXPR with addressable return type.
* g++.dg/opt/pr82159-2.C: New test.
From-SVN: r253673
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -6749,8 +6749,11 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos, return const0_rtx; /* If we have nothing to store, do nothing unless the expression has - side-effects. */ - if (bitsize == 0) + side-effects. Don't do that for zero sized addressable lhs of + calls. */ + if (bitsize == 0 + && (!TREE_ADDRESSABLE (TREE_TYPE (exp)) + || TREE_CODE (exp) != CALL_EXPR)) return expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL); if (GET_CODE (target) == CONCAT) |