------- Additional Comments From aoliva at gcc dot gnu dot org 2005-04-16 21:48 ------- Subject: Re: [PR target/20126, RFC] loop DEST_ADDR biv replacement may fail
On Apr 15, 2005, Roger Sayle <[EMAIL PROTECTED]> wrote: > Sure. Your patch in comment #28 of bugzilla PR20126 is OK for mainline > to resolve Josh's bootstrap failure. Sounds like you've already done > the necessary testing, and I'll trust you on a suitable ChangeLog entry. Thanks, here's what I've just checked in. Index: gcc/ChangeLog from Alexandre Oliva <[EMAIL PROTECTED]> PR target/20126 * loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg) (const)). Index: gcc/loop.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/loop.c,v retrieving revision 1.526 diff -u -p -r1.526 loop.c --- gcc/loop.c 10 Apr 2005 04:00:45 -0000 1.526 +++ gcc/loop.c 16 Apr 2005 21:40:02 -0000 @@ -5488,6 +5488,15 @@ loop_givs_rescan (struct loop *loop, str loop_insn_emit_before (loop, 0, v->insn, gen_move_insn (*v->location, v->new_reg)); + else if (GET_CODE (*v->location) == PLUS + && REG_P (XEXP (*v->location, 0)) + && CONSTANT_P (XEXP (*v->location, 1))) + loop_insn_emit_before (loop, 0, v->insn, + gen_move_insn (XEXP (*v->location, 0), + gen_rtx_MINUS + (GET_MODE (*v->location), + v->new_reg, + XEXP (*v->location, 1)))); else { /* If it wasn't a reg, create a pseudo and use that. */ -- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer [EMAIL PROTECTED], gcc.gnu.org} Free Software Evangelist [EMAIL PROTECTED], gnu.org} -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20126