[multiple changes]

2000-12-27  Geoffrey Keating  <geoffk@redhat.com>

	* config/rs6000/rs6000.md (define_attr "length"): Correct
	calculation.

2000-12-26  Geoffrey Keating  <geoffk@redhat.com>

	* gcc.c-torture/compile/20001226-1.c: New test.

From-SVN: r38495
This commit is contained in:
Geoffrey Keating 2000-12-27 11:01:03 +00:00 committed by Geoffrey Keating
parent b370937715
commit 6cbadf36b2
4 changed files with 40 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2000-12-27 Geoffrey Keating <geoffk@redhat.com>
* config/rs6000/rs6000.md (define_attr "length"): Correct
calculation.
2000-12-26 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.c: Fix a comment typo.

View File

@ -41,12 +41,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 4)
(const_int 8))
(const_int 4)))

View File

@ -1,3 +1,7 @@
2000-12-26 Geoffrey Keating <geoffk@redhat.com>
* gcc.c-torture/compile/20001226-1.c: New test.
2000-12-22 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.c-torture/compile/20001222-1.c: New test.

View File

@ -0,0 +1,26 @@
/* This testcase exposed two branch shortening bugs on powerpc. */
#define C(a,b) \
if (a > b) goto gt; \
if (a < b) goto lt;
#define C4(x,b) C((x)[0], b) C((x)[1],b) C((x)[2],b) C((x)[3],b)
#define C16(x,y) C4(x, (y)[0]) C4(x, (y)[1]) C4(x, (y)[2]) C4(x, (y)[3])
#define C64(x,y) C16(x,y) C16(x+4,y) C16(x+8,y) C16(x+12,y)
#define C256(x,y) C64(x,y) C64(x,y+4) C64(x,y+8) C64(x,y+12)
#define C1024(x,y) C256(x,y) C256(x+16,y) C256(x+32,y) C256(x+48,y)
#define C4096(x,y) C1024(x,y) C1024(x,y+16) C1024(x,y+32) C1024(x,y+48)
unsigned foo(int x[64], int y[64])
{
C4096(x,y);
return 0x01234567;
gt:
return 0x12345678;
lt:
return 0xF0123456;
}