$NetBSD: patch-ah,v 1.3 2002/03/28 10:11:52 jmc Exp $

--- ../gcc-2.95.3/gcc/config/arm/arm.md.orig 2001/04/23 11:59:31 1.1.1.2
+++ ../gcc-2.95.3/gcc/config/arm/arm.md 2001/11/08 20:47:56 1.3
@@ -1682,9 +1682,9 @@
 	    (match_operand:SI 3 "arm_rhs_operand" "rI,rI")])
 	  (match_operand:SI 1 "s_register_operand" "0,?r")]))
    (clobber (reg:CC 24))]
-  "GET_CODE (operands[1]) != REG
+  "0 && (GET_CODE (operands[1]) != REG
    || (REGNO(operands[1]) != FRAME_POINTER_REGNUM
-       && REGNO(operands[1]) != ARG_POINTER_REGNUM)"
+       && REGNO(operands[1]) != ARG_POINTER_REGNUM))"
   "*
 {
   enum rtx_code code = GET_CODE (operands[4]);
@@ -4322,6 +4322,29 @@
 }"
 [(set_attr "conds" "use")
  (set_attr "type" "load")])
+
+(define_expand "return_addr_mask"
+  [(set (match_dup 1)
+	(compare:CC_NOOV (unspec [(const_int 0)] 4)
+			 (const_int 0)))
+   (set (match_operand:SI 0 "s_register_operand" "")
+	(if_then_else:SI (eq (match_dup 1) (const_int 0))
+			 (const_int -1)
+			 (const_int 67108860)))] ; 0x03fffffc
+  ""
+  "
+  operands[1] = gen_rtx_REG (CC_NOOVmode, 24);
+  ")
+
+(define_insn "*check_arch2"
+  [(set (match_operand:CC_NOOV 0 "cc_register" "")
+	(compare:CC_NOOV (unspec [(const_int 0)] 4)
+			 (const_int 0)))]
+  ""
+  "teq\\t%|r0, %|r0\;teq\\t%|pc, %|pc"
+  [(set_attr "length" "8")
+   (set_attr "conds" "set")]
+)
 
 ;; Call subroutine returning any type.
 
