This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
regmove.c inconsistencies
- To: egcs at cygnus dot com
- Subject: regmove.c inconsistencies
- From: john at feith dot com (John Wehle)
- Date: Mon, 13 Jul 1998 00:29:55 -0400
- Cc: egcs-patches at cygnus dot com
The following inconsistencies came up while looking into the i386
performance regression due to the June 11 regmove change.
1) In copy_src_to_dest is:
REG_N_SETS (dest_regno) += loop_depth;
however the rest of regmove.c merely increments (or decrements)
REG_N_SETS by one.
2) In copy_src_to_dest is:
REG_N_REFS (dest_regno) += loop_depth;
however it would seem that the number of references should be
changed by a factor of two since src has been replaced by dest
in insn and a move instruction has been added which sets dest.
3) Could someone comment on the theory behind loop_depth?
Attached is a patch which changes copy_src_to_dest to be consistent with
the apparent usage of REG_N_SETS and REG_N_REFS in the rest of regmove.c
Don't know if this patch is correct ... I really wish someone knowledgeable
about regmove would speak up regarding these issues.
ChangeLog:
Sun Jul 12 23:02:54 EDT 1998 John Wehle (john@feith.com)
* regmove.c (copy_src_to_dest): Correct the updating of
REG_N_SETS and REG_N_REFS for dest_regno.
Enjoy!
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/regmove.c.ORIGINAL Sat Jul 11 02:17:21 1998
--- gcc/regmove.c Sun Jul 12 23:05:02 1998
***************
*** 610,617 ****
/* Update the various register tables. */
dest_regno = REGNO (dest);
! REG_N_SETS (dest_regno) += loop_depth;
! REG_N_REFS (dest_regno) += loop_depth;
REG_LIVE_LENGTH (dest_regno)++;
if (REGNO_FIRST_UID (dest_regno) == insn_uid)
REGNO_FIRST_UID (dest_regno) = move_uid;
--- 610,617 ----
/* Update the various register tables. */
dest_regno = REGNO (dest);
! REG_N_SETS (dest_regno)++;
! REG_N_REFS (dest_regno) += 2 * loop_depth;
REG_LIVE_LENGTH (dest_regno)++;
if (REGNO_FIRST_UID (dest_regno) == insn_uid)
REGNO_FIRST_UID (dest_regno) = move_uid;
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------