This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/RFC] MEM_COPY_ATTRIBUTES doesn't copy MEM_POINTER flag


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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]