This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[mips patch RFA] handle trap_if with DI-mode arguments.


On MIPS platforms with 64-bit 'long', e.g., mipsisa64-elf (eabi) , or
mips64-linux w/ n64 ABI, the gcc.c-torture/compile/20030605-1.c test
would fail like:

/home/cgd/proj/gcc-testing6/combined/gcc/testsuite/gcc.c-torture/compile/20030605-1.c:12: error: unrecognizable insn:
(insn 26 10 17 0 (trap_if (eq (reg:DI 183)
            (const_int 0 [0x0]))
        (const_int 0 [0x0])) -1 (insn_list 10 (nil))
    (expr_list:REG_DEAD (reg:DI 183)
        (nil)))
/home/cgd/proj/gcc-testing6/combined/gcc/testsuite/gcc.c-torture/compile/20030605-1.c:12: internal compiler error: in extract_insn, at recog.c:2064


The following patch addresses the issue, by matching a trap_if that
has DI-mode arguments.  (there's an existing pattern that matches
SI-mode arguments only.)

I'm not really sure that this is The Right Thing (e.g., it might be
better to make the other pattern somehow more generic), but it fixes
that test for:

        Target is mipsisa64-unknown-elf
        Host   is i686-pc-linux-gnu

        Schedule of variations:
            mips-sim-idt64/-mips32
            mips-sim-idt64

(the latter variation had the FAIL.)  Only difference in test results
is for that test, FAIL -> PASS.  Yay.



chris
--
2003-08-13  Chris Demetriou  <cgd@broadcom.com>

	* config/mips/mips.md: Define new instruction to handle "trap_if"
	with DI-mode arguments.

Index: config/mips/mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.187
diff -u -p -r1.187 mips.md
--- config/mips/mips.md	11 Aug 2003 15:28:20 -0000	1.187
+++ config/mips/mips.md	13 Aug 2003 20:20:56 -0000
@@ -672,6 +672,14 @@
 	    (const_int 0))]
   "ISA_HAS_COND_TRAP"
   "t%C0\\t%z1,%z2")
+
+(define_insn ""
+  [(trap_if (match_operator 0 "trap_cmp_op"
+                            [(match_operand:DI 1 "reg_or_0_operand" "d")
+                             (match_operand:DI 2 "nonmemory_operand" "dI")])
+	    (const_int 0))]
+  "TARGET_64BIT && ISA_HAS_COND_TRAP"
+  "t%C0\\t%z1,%z2")
 
 ;;
 ;;  ....................


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]