re PR rtl-optimization/59278 (combine does not replace matched insn)
authorOleg Endo <olegendo@gcc.gnu.org>
Mon, 1 Dec 2014 23:53:12 +0000 (23:53 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Mon, 1 Dec 2014 23:53:12 +0000 (23:53 +0000)
testsuite/
PR rtl-optimization/59278
* gcc.target/sh/pr59278.c: New.

From-SVN: r218251

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/pr59278.c [new file with mode: 0644]

index 3f14726..dff9d02 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-01  Oleg Endo  <olegendo@gcc.gnu.org>
+
+       PR rtl-optimization/59278
+       * gcc.target/sh/pr59278.c: New.
+
 2014-12-01  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60859
diff --git a/gcc/testsuite/gcc.target/sh/pr59278.c b/gcc/testsuite/gcc.target/sh/pr59278.c
new file mode 100644 (file)
index 0000000..563e5b7
--- /dev/null
@@ -0,0 +1,19 @@
+/* Check that combine considers unused regs dead.  */
+/* { dg-do compile }  */
+/* { dg-options "-O1" }  */
+/* { dg-skip-if "" { "sh*-*-*" } { "-m5*"} { "" } }  */
+/* { dg-final { scan-assembler "addc" } }  */
+
+struct result
+{
+  int a, b;
+};
+
+struct result
+test_00 (int a, int b, int d)
+{
+  struct result r;
+  r.a = a != b;
+  r.b = d + b + 1;
+  return r;
+}