From: Bernd Schmidt Date: Mon, 1 Jan 2001 17:43:04 +0000 (+0000) Subject: Backport PPC length calculation fix X-Git-Tag: prereleases/gcc-2.95.3-test1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b974b69e7542e1cc8ba71365a639b29878726c2;p=thirdparty%2Fgcc.git Backport PPC length calculation fix From-SVN: r38592 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0cd53639b60d..81de93c933c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-01-01 Bernd Schmidt + + 2000-12-27 Geoffrey Keating + * config/rs6000/rs6000.md (define_attr "length"): Correct + calculation. + 2001-01-01 Philipp Thomas * configure.in: Make the help for --enable-nls make it diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 3a0fa7c920c1..c8078e0712d5 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -27,12 +27,14 @@ (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)))