diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-02-21 00:02:29 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-02-21 00:02:29 +0100 |
commit | 37d7267f8093e6720b05fec5a8eac26ade0b55ad (patch) | |
tree | 800b38ba1aeb67ced6a80af833fb949859b4a090 /gcc/expr.c | |
parent | cd56fb7957a9b2b685f7dec2db6307bde5a0d4f0 (diff) | |
download | gcc-37d7267f8093e6720b05fec5a8eac26ade0b55ad.zip gcc-37d7267f8093e6720b05fec5a8eac26ade0b55ad.tar.gz gcc-37d7267f8093e6720b05fec5a8eac26ade0b55ad.tar.bz2 |
re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686-linux-gnu)
PR middle-end/89412
* expr.c (expand_assignment): If result is a MEM, use change_address
instead of simplify_gen_subreg.
* gcc.c-torture/compile/pr89412.c: New test.
From-SVN: r269057
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -5211,9 +5211,13 @@ expand_assignment (tree to, tree from, bool nontemporal) } else { - rtx from_rtx - = simplify_gen_subreg (to_mode, result, - TYPE_MODE (TREE_TYPE (from)), 0); + rtx from_rtx; + if (MEM_P (result)) + from_rtx = change_address (result, to_mode, NULL_RTX); + else + from_rtx + = simplify_gen_subreg (to_mode, result, + TYPE_MODE (TREE_TYPE (from)), 0); if (from_rtx) { emit_move_insn (XEXP (to_rtx, 0), |