This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, mips] Micromips delay slot fix
- From: "Steve Ellcey " <sellcey at mips dot com>
- To: <rdsandiford at googlemail dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Jun 2013 12:48:58 -0700
- Subject: [patch, mips] Micromips delay slot fix
We found a bug in the micromips implementation where the branch delay slot
was not getting filled for micromips. You can reproduce this with a program
that just has an empty main function. Andrew Bennett created this fix for
it and we would like to check it in. I am submitting it for Andrew since he
doesn't have write access.
OK to checkin?
2013-06-10 Andrew Bennett <andrew.bennett@imgtec.com>
Steve Ellcey <sellcey@mips.com>
* config/mips/mips.md (single_insn): Fix attribute for micromips.
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 2fdc79d..f18ab50 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -704,7 +704,9 @@
;; Is it a single instruction?
(define_attr "single_insn" "no,yes"
- (symbol_ref "(get_attr_length (insn) == (TARGET_MIPS16 ? 2 : 4)
+ (symbol_ref "(((TARGET_MIPS16 || TARGET_MICROMIPS)
+ && get_attr_length (insn) == 2)
+ || (!TARGET_MIPS16 && get_attr_length (insn) == 4)
? SINGLE_INSN_YES : SINGLE_INSN_NO)"))
;; Can the instruction be put into a delay slot?