re PR target/74563 (Classic MIPS16 (non-MIPS16e) function return broken)
authorJeff Law <law@redhat.com>
Wed, 19 Apr 2017 04:52:54 +0000 (22:52 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 19 Apr 2017 04:52:54 +0000 (22:52 -0600)
PR target/74563
* mips.md ({return,simple_return}_internal): Do not overwrite
operands[0].

PR target/74563
* gcc.target/mips/pr74563: New test.

From-SVN: r246987

gcc/ChangeLog
gcc/config/mips/mips.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/pr74563.c [new file with mode: 0644]

index ea44ddb553ea3f015ada80eb38d706f25b14fdf2..7aa8c03c45b4ae1eea6130f81c3745515e3074aa 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-18  Jeff Law  <law@redhat.com>
+
+       PR target/74563
+       * mips.md ({return,simple_return}_internal): Do not overwrite
+       operands[0].
+
 2017-04-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/80443
index 7acf00d0451d82c906fb5a86ece521d3c9ee6fc6..28e0a444ba9d76ad9d29451216a3b898771d76c4 100644 (file)
    (use (match_operand 0 "pmode_register_operand" ""))]
   ""
   {
-    operands[0] = gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM);
     return mips_output_jump (operands, 0, -1, false);
   }
   [(set_attr "type"    "jump")
index 11410bb7045f8364664fc77a927346fd361a8d9a..c21e3733ed42fae8653385c21093562700b019af 100644 (file)
@@ -1,3 +1,8 @@
+2017-04-18  Jeff Law  <law@redhat.com>
+
+       PR target/74563
+       * gcc.target/mips/pr74563: New test.
+
 2017-04-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/80443
diff --git a/gcc/testsuite/gcc.target/mips/pr74563.c b/gcc/testsuite/gcc.target/mips/pr74563.c
new file mode 100644 (file)
index 0000000..09545fc
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-mips3 -mips16 -msoft-float" } */
+
+void f2(void);
+
+void f1(void)
+{
+        f2();
+}
+
+/* { dg-final { scan-assembler-not "\tjr\t\\\$31" } } */
+/* { dg-final { scan-assembler "\tjr\t\\\$7" } } */
+
+