diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2016-02-10 18:01:40 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2016-02-10 18:01:40 +0000 |
commit | e03dd76578bb5e8b6d5ba2a2628d349bd5c822bf (patch) | |
tree | c136e4cca5309a1b6a42fe765f6983429e68dd1a | |
parent | 89908c8f2b5107f92dcd9a33098797cdf848a151 (diff) | |
download | gcc-e03dd76578bb5e8b6d5ba2a2628d349bd5c822bf.zip gcc-e03dd76578bb5e8b6d5ba2a2628d349bd5c822bf.tar.gz gcc-e03dd76578bb5e8b6d5ba2a2628d349bd5c822bf.tar.bz2 |
re PR target/69148 (ICE (floating point exception) on s390x-linux-gnu)
2016-02-10 Vladimir Makarov <vmakarov@redhat.com>
PR target/69148
* lra-constraints.c (curr_insn_transform): Find in/out operands
for secondary memory moves. Update dups.
2016-02-10 Vladimir Makarov <vmakarov@redhat.com>
PR target/69468
* gcc.target/s390/pr69148.c: New.
From-SVN: r233283
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lra-constraints.c | 28 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/pr69148.c | 16 |
4 files changed, 48 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac3dbbc..b4495d8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-02-10 Vladimir Makarov <vmakarov@redhat.com> + + PR target/69148 + * lra-constraints.c (curr_insn_transform): Find in/out operands + for secondary memory moves. Update dups. + 2016-02-10 Yuri Rumyantsev <ysrumyan@gmail.com> PR tree-optimization/69652 diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 08cf0aa..751ec3e 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -3559,14 +3559,26 @@ curr_insn_transform (bool check_only_p) if (use_sec_mem_p) { + int in = -1, out = -1; rtx new_reg, src, dest, rld; machine_mode sec_mode, rld_mode; - lra_assert (sec_mem_p); - lra_assert (curr_static_id->operand[0].type == OP_OUT - && curr_static_id->operand[1].type == OP_IN); - dest = *curr_id->operand_loc[0]; - src = *curr_id->operand_loc[1]; + lra_assert (curr_insn_set != NULL_RTX && sec_mem_p); + dest = SET_DEST (curr_insn_set); + src = SET_SRC (curr_insn_set); + for (i = 0; i < n_operands; i++) + if (*curr_id->operand_loc[i] == dest) + out = i; + else if (*curr_id->operand_loc[i] == src) + in = i; + for (i = 0; i < curr_static_id->n_dups; i++) + if (out < 0 && *curr_id->dup_loc[i] == dest) + out = curr_static_id->dup_num[i]; + else if (in < 0 && *curr_id->dup_loc[i] == src) + in = curr_static_id->dup_num[i]; + lra_assert (out >= 0 && in >= 0 + && curr_static_id->operand[out].type == OP_OUT + && curr_static_id->operand[in].type == OP_IN); rld = (GET_MODE_SIZE (GET_MODE (dest)) <= GET_MODE_SIZE (GET_MODE (src)) ? dest : src); rld_mode = GET_MODE (rld); @@ -3599,14 +3611,16 @@ curr_insn_transform (bool check_only_p) } else if (dest == rld) { - *curr_id->operand_loc[0] = new_reg; + *curr_id->operand_loc[out] = new_reg; + lra_update_dup (curr_id, out); after = emit_spill_move (false, new_reg, dest); lra_process_new_insns (curr_insn, NULL, after, "Inserting the sec. move"); } else { - *curr_id->operand_loc[1] = new_reg; + *curr_id->operand_loc[in] = new_reg; + lra_update_dup (curr_id, in); /* See comments above. */ push_to_sequence (before); before = emit_spill_move (true, new_reg, src); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6eb0aaa..090b3dd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-02-10 Vladimir Makarov <vmakarov@redhat.com> + + PR target/69468 + * gcc.target/s390/pr69148.c: New. + 2016-02-10 Yuri Rumyantsev <ysrumyan@gmail.com> PR tree-optimization/69652 diff --git a/gcc/testsuite/gcc.target/s390/pr69148.c b/gcc/testsuite/gcc.target/s390/pr69148.c new file mode 100644 index 0000000..5570b52 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/pr69148.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O -march=z196 -m64 -w" } */ +union U { int r; float f; }; +struct A { + int a; + union U b[64]; + }; + double foo (double); + +void +bar (struct A *z, int x) +{ + union U y; + y.f = foo (z->b[x].f); + z->a = y.r ? 4 : y.r; +} |