regmove question

Joern Rennecke amylaar@cygnus.co.uk
Tue Aug 31 18:03:00 GMT 1999


> The testcase for this is execute/990829-1.c -O2 on i686-pc-linux-gnu.

regmove confuses itself because it causes an unchanging regsiter to change.
If have tested the following patch with the testcase, but not bootstrapped
yet.

Wed Sep  1 01:59:02 1999  J"orn Rennecke <amylaar@cygnus.co.uk>

	* regmove.c (fixup_match_1): Don't change an unchanging register.

Index: regmove.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/regmove.c,v
retrieving revision 1.62
diff -p -r1.62 regmove.c
*** regmove.c	1999/08/31 19:39:06	1.62
--- regmove.c	1999/09/01 00:59:01
*************** fixup_match_1 (insn, set, src, src_subre
*** 1664,1669 ****
--- 1664,1675 ----
    rtx src_note = find_reg_note (insn, REG_DEAD, src), dst_note;
    int length, s_length, true_loop_depth;
  
+   /* If SRC is marked as unchanging, we may not change it.
+      ??? Maybe we could get better code by removing the unchanging bit
+      instead, and changing it back if we don't succeed?  */
+   if (RTX_UNCHANGING_P (src))
+     return 0;
+ 
    if (! src_note)
      {
        /* Look for (set (regX) (op regA constX))


More information about the Gcc-patches mailing list