[PATCH/RFC] MEM_COPY_ATTRIBUTES doesn't copy MEM_POINTER flag
Peter Bergner
bergner@vnet.ibm.com
Wed Nov 8 05:24:00 GMT 2006
While tracking down a problem in PR28690 (indexed load/store preformance
regression). I noticed that MEM_COPY_ATTRIBUTES() wasn't copying the
MEM_POINTER flag along with the other MEM attributes. This causes
change_address_1() to take RTL like the following (from the PR):
(mem/f/c/i:SI (symbol_ref:SI ("base") [flags 0x84] <var_decl 0x400a6930 base>) [3 base+0 S4 A32])
and generate:
(mem/c/i:SI (reg/f:SI 128) [3 base+0 S4 A32])
It seems like we want the MEM_POINTER flag to be copied to the new mem,
so the following patch is fairly obvious, but thought I would ask in
case not copying the MEM_POINTER flag was intentional.
Peter
* rtl.h (MEM_COPY_ATTRIBUTES): Copy MEM_POINTER.
Index: rtl.h
===================================================================
--- rtl.h (revision 117397)
+++ rtl.h (working copy)
@@ -1196,6 +1196,7 @@
MEM_NOTRAP_P (LHS) = MEM_NOTRAP_P (RHS), \
MEM_READONLY_P (LHS) = MEM_READONLY_P (RHS), \
MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
+ MEM_POINTER (LHS) = MEM_POINTER (RHS), \
MEM_ATTRS (LHS) = MEM_ATTRS (RHS))
/* 1 if RTX is a label_ref for a nonlocal label. */
More information about the Gcc-patches
mailing list