[PATCH] fix for web pass
Roman Zippel
zippel@linux-m68k.org
Sat Jun 5 13:54:00 GMT 2004
Hi,
The patch below fixes a problem in the web pass fixes. The 960416-1 test
case produces a instruction like this for m68k:
(insn 30 28 31 3 (parallel [
(set (subreg:SI (reg:DI 48) 4)
(mult:SI (reg/v:SI 41 [ ad ])
(reg/v:SI 42 [ bd ])))
(set (subreg:SI (reg:DI 48) 0)
(truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (reg/v:SI 41 [ ad ]))
(zero_extend:DI (reg/v:SI 42 [ bd ])))
(const_int 32 [0x20]))))
]) 130 {*m68k.md:2527} (nil)
(nil))
Data flow analysis finds two defs for the two sets here, but union_defs
uses only one of it to create a union. The result is that the web pass
thinks the two uses of (reg 48) are independent and replaces one of it
with a new register.
The patch is tested on m68k-linux and i586-linux.
bye, Roman
2004-06-05 Roman Zippel <zippel@linux-m68k.org>
* web.c (union_defs): use all defs of an instruction to create a
union with a read/write use
Index: web.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/web.c,v
retrieving revision 2.9
diff -u -r2.9 web.c
--- web.c 15 May 2004 09:39:29 -0000 2.9
+++ web.c 26 May 2004 23:43:36 -0000
@@ -160,11 +160,13 @@
{
struct df_link *link = DF_INSN_DEFS (df, DF_REF_INSN (use));
- while (DF_REF_REAL_REG (link->ref) != DF_REF_REAL_REG (use))
- link = link->next;
-
- unionfind_union (use_entry + DF_REF_ID (use),
- def_entry + DF_REF_ID (link->ref));
+ while (link)
+ {
+ if (DF_REF_REAL_REG (link->ref) == DF_REF_REAL_REG (use))
+ unionfind_union (use_entry + DF_REF_ID (use),
+ def_entry + DF_REF_ID (link->ref));
+ link = link->next;
+ }
}
}
More information about the Gcc-patches
mailing list