]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport PPC length calculation fix
authorBernd Schmidt <bernds@redhat.co.uk>
Mon, 1 Jan 2001 17:43:04 +0000 (17:43 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 1 Jan 2001 17:43:04 +0000 (17:43 +0000)
From-SVN: r38592

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index 0cd53639b60d9fe0a0229450524f03f80bb29051..81de93c933c4cb4c894fcde322b6d5fbc6ad45be 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-01  Bernd Schmidt  <bernds@redhat.co.uk>
+
+       2000-12-27  Geoffrey Keating  <geoffk@redhat.com>
+       * config/rs6000/rs6000.md (define_attr "length"): Correct
+       calculation.
+
 2001-01-01  Philipp Thomas <pthomas@suse.de>
 
        * configure.in: Make the help for --enable-nls make it
index 3a0fa7c920c1133b0838dd37ed3aa1115f2f61f2..c8078e0712d5bf6a3f93be08364b7572d9d3cf14 100644 (file)
   (const_string "integer"))
 
 ;; Length (in bytes).
+; '(pc)' in the following doesn't include the instruction itself; it is 
+; calculated as if the instruction had zero size.
 (define_attr "length" ""
   (if_then_else (eq_attr "type" "branch")
-               (if_then_else (and (ge (minus (pc) (match_dup 0))
+               (if_then_else (and (ge (minus (match_dup 0) (pc))
                                       (const_int -32768))
-                                  (lt (minus (pc) (match_dup 0))
-                                      (const_int 32767)))
+                                  (lt (minus (match_dup 0) (pc))
+                                      (const_int 32764)))
                              (const_int 8)
                              (const_int 12))
                (const_int 4)))