OSDN Git Service

PR target/57568
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Jun 2013 18:37:51 +0000 (18:37 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Jun 2013 18:37:51 +0000 (18:37 +0000)
* config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
that operands[2] doesn't overlap with operands[0].

* gcc.c-torture/execute/pr57568.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@199872 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr57568.c [new file with mode: 0644]

index d6ed9bb..f74e049 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/57568
+       * config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
+       that operands[2] doesn't overlap with operands[0].
+
 2013-05-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/57356
index b0e278e..c76cd6b 100644 (file)
   "(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
    && peep2_reg_dead_p (4, operands[0])
    && !reg_overlap_mentioned_p (operands[0], operands[1])
+   && !reg_overlap_mentioned_p (operands[0], operands[2])
    && (<MODE>mode != QImode
        || immediate_operand (operands[2], QImode)
        || q_regs_operand (operands[2], QImode))
        || immediate_operand (operands[2], SImode)
        || q_regs_operand (operands[2], SImode))
    && !reg_overlap_mentioned_p (operands[0], operands[1])
+   && !reg_overlap_mentioned_p (operands[0], operands[2])
    && ix86_match_ccmode (peep2_next_insn (3),
                         (GET_CODE (operands[3]) == PLUS
                          || GET_CODE (operands[3]) == MINUS)
index f80afa0..d1abd62 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/57568
+       * gcc.c-torture/execute/pr57568.c: New test.
+
 2013-06-06  Tobias Burnus  <burnus@net-b.de>
 
        Backport from mainline
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr57568.c b/gcc/testsuite/gcc.c-torture/execute/pr57568.c
new file mode 100644 (file)
index 0000000..9a7ddb0
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR target/57568 */
+
+extern void abort (void);
+int a[6][9] = { }, b = 1, *c = &a[3][5];
+
+int
+main ()
+{
+  if (b && (*c = *c + *c))
+    abort ();
+  return 0;
+}