This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
sparc.c short branch bug
- To: gcc-patches at gcc dot gnu dot org
- Subject: sparc.c short branch bug
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Mon, 5 Jun 00 14:27:47 EDT
The comparison function was being manually optimized, but it was done
wrong. The compiler will optimization the expression anyway and the
function isn't that commonly called in the first place, so I replaced
it with the straightforward comparison.
Mon Jun 5 13:57:22 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* sparc.c (short_branch): Correct error in range computation.
*** config/sparc/sparc.c.old Sun Nov 29 06:30:19 1998
--- config/sparc/sparc.c Mon Jun 5 12:26:42 2000
*************** short_branch (uid1, uid2)
*** 1290,1297 ****
int uid1, uid2;
{
! unsigned int delta = insn_addresses[uid1] - insn_addresses[uid2];
! if (delta + 1024 < 2048)
return 1;
! /* warning ("long branch, distance %d", delta); */
return 0;
}
--- 1290,1299 ----
int uid1, uid2;
{
! int delta = insn_addresses[uid1] - insn_addresses[uid2];
!
! /* Leave a few words of "slop". */
! if (delta >= -1023 && delta <= 1022)
return 1;
!
return 0;
}