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]

Patch to improve memrefs_conflist_p ADDRESSOF handling


Inspired by Richard's comment.  A memory reference using an addressof
can't conflict with any other stack references.  This patch passes make
bootstrap and make check on FreeBSD-3.5 x86.

ChangeLog:

Sat Sep  9 07:31:37 EDT 2000  John Wehle  (john@feith.com)

	* alias.c (memrefs_conflict_p): An ADDRESSOF doesn't conflict.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/alias.c.ORIGINAL	Fri Sep  8 21:33:00 2000
--- gcc/alias.c	Sat Sep  9 07:27:09 2000
*************** memrefs_conflict_p (xsize, x, ysize, y, 
*** 1453,1458 ****
--- 1456,1464 ----
  	ysize = -1;
        return memrefs_conflict_p (xsize, x, ysize, XEXP (y, 0), c);
      }
+ 
+   if (GET_CODE (x) == ADDRESSOF || GET_CODE (y) == ADDRESSOF)
+     return xsize <= 0 || ysize <= 0;
  
    if (CONSTANT_P (x))
      {
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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