aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2013-06-08 18:37:40 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2013-06-08 18:37:40 +0000
commited52a84e3ffde82c52557d0f027488d9fe69563f (patch)
treeab8306145143473f85493065bdb87f06d1bef071
parent7b91690215d275028eacf31f75a22aaa9bc4f3b2 (diff)
downloadgcc-ed52a84e3ffde82c52557d0f027488d9fe69563f.zip
gcc-ed52a84e3ffde82c52557d0f027488d9fe69563f.tar.gz
gcc-ed52a84e3ffde82c52557d0f027488d9fe69563f.tar.bz2
re PR rtl-optimization/57559 (S/390: ICE with lra)
2013-06-08 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/57559 * lra-constraints.c (process_alt_operands): Don't discourage memory with known offset for offsetable memory constraint. * lra.c (lra_emit_add): Exchange y and z for 2-op add insn. 2013-06-08 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/57559 * gcc.target/s390/pr57559.c : New test. From-SVN: r199859
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/lra-constraints.c11
-rw-r--r--gcc/lra.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/s390/pr57559.c24
5 files changed, 41 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 86795e7..12d773c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2013-06-08 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/57559
+ * lra-constraints.c (process_alt_operands): Don't discourage
+ memory with known offset for offsetable memory constraint.
+ * lra.c (lra_emit_add): Exchange y and z for 2-op add insn.
+
2013-06-08 Eric Botcazou <ebotcazou@adacore.com>
* varasm.c (struct oc_local_state): Reorder fields.
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index a9f91c4..ed84d95 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1997,15 +1997,8 @@ process_alt_operands (int only_alternative)
(op, this_alternative) == NO_REGS))))
reject += LRA_MAX_REJECT;
- if (MEM_P (op) && offmemok)
- {
- /* If we know offset and this non-offsetable memory,
- something wrong with this memory and it is better
- to try other memory possibilities. */
- if (MEM_OFFSET_KNOWN_P (op))
- reject += LRA_MAX_REJECT;
- }
- else if (! (const_to_mem && constmemok))
+ if (! (MEM_P (op) && offmemok)
+ && ! (const_to_mem && constmemok))
{
/* We prefer to reload pseudos over reloading other
things, since such reloads may be able to be
diff --git a/gcc/lra.c b/gcc/lra.c
index 7c6bff1..51f1707 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -306,11 +306,11 @@ lra_emit_add (rtx x, rtx y, rtx z)
|| (disp != NULL_RTX && ! CONSTANT_P (disp))
|| (scale != NULL_RTX && ! CONSTANT_P (scale)))
{
- /* Its is not an address generation. Probably we have no 3 op
+ /* It is not an address generation. Probably we have no 3 op
add. Last chance is to use 2-op add insn. */
lra_assert (x != y && x != z);
- emit_move_insn (x, z);
- insn = gen_add2_insn (x, y);
+ emit_move_insn (x, y);
+ insn = gen_add2_insn (x, z);
emit_insn (insn);
}
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e4fd6ab..b8fe362 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-08 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/57559
+ * gcc.target/s390/pr57559.c : New test.
+
2013-06-08 Tobias Burnus <burnus@net-b.de>
PR fortran/37336
diff --git a/gcc/testsuite/gcc.target/s390/pr57559.c b/gcc/testsuite/gcc.target/s390/pr57559.c
new file mode 100644
index 0000000..15c3878
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr57559.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/57559 */
+
+/* { dg-do compile } */
+/* { dg-options "-march=z10 -m64 -mzarch -O1" } */
+
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+struct _IO_marker
+{
+};
+static const int32_t mfcone = 1;
+static const uint8_t *mfctop = (const uint8_t *) &mfcone;
+int32_t
+decContextTestEndian (uint8_t quiet)
+{
+ int32_t res = 0;
+ uint32_t dle = (uint32_t) 0;
+ if (*(int *) 10 != 0)
+ {
+ res = (int32_t) * mfctop - dle;
+ }
+ return res;
+}