/usr/src/gcc-5/debian/patches/pr69148.diff is in gcc-5-source 5.5.0-12ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | # DP: Fix PR target/69148 (s390x), taken from the trunk
gcc/
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.
gcc/testsuite/
2016-02-10 Vladimir Makarov <vmakarov@redhat.com>
PR target/69468
* gcc.target/s390/pr69148.c: New.
Index: b/src/cc/testsuite/gcc.target/s390/pr69148.c
===================================================================
--- /dev/null
+++ b/src/cc/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;
+}
Index: b/src/gcc/lra-constraints.c
===================================================================
--- a/src/gcc/lra-constraints.c
+++ b/src/gcc/lra-constraints.c
@@ -3540,14 +3540,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);
@@ -3580,14 +3592,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);
|