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]

[committed] fix branch length attribute


This fixes 20001226-1.c for -Os on mainline. We weren't quite getting
the branch length calculation correct and that testcase tripped it.

-eric

-- 
Eric Christopher <echristo@redhat.com>

2004-05-03  Eric Christopher  <echristo@redhat.com>

	* config/mips/mips.md: Fix branch length attribute definition.

Index: mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.238
diff -u -p -w -r1.238 mips.md
--- mips.md	29 Apr 2004 19:54:17 -0000	1.238
+++ mips.md	3 May 2004 22:25:57 -0000
@@ -168,10 +168,11 @@
 	  ;; Note that this value does not account for the delay slot
 	  ;; instruction, whose length is added separately.  If the RTL
 	  ;; pattern has no explicit delay slot, mips_adjust_insn_length
-	  ;; will add the length of the implicit nop.
+	  ;; will add the length of the implicit nop.  The values for
+	  ;; forward and backward branches will be different as well.
 	  (eq_attr "type" "branch")
-          (cond [(lt (abs (minus (match_dup 1) (plus (pc) (const_int
4))))
-                     (const_int 131072))
+	  (cond [(and (le (minus (match_dup 1) (pc)) (const_int 131064))
+                      (le (minus (pc) (match_dup 1)) (const_int
131068)))
                  (const_int 4)
 		 (ne (symbol_ref "flag_pic") (const_int 0))
 		 (const_int 24)



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