This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix true_dependence & write_dependence_p oops
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch to fix true_dependence & write_dependence_p oops
- From: John Wehle <john at feith dot com>
- Date: Mon, 21 Aug 2000 00:11:03 -0400 (EDT)
Oops ... The address should be passed to find_base_term instead
of the mem. This patch passes make bootstrap and make check on
FreeBSD-3.5 x86.
ChangeLog:
Sun Aug 20 23:52:47 EDT 2000 John Wehle (john@feith.com)
* alias.c (true_dependence, write_dependence_p): Fix
bug in previous patch.
Enjoy!
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/alias.c.ORIGINAL Thu Aug 17 22:38:52 2000
--- gcc/alias.c Sun Aug 20 03:06:26 2000
*************** true_dependence (mem, mem_mode, x, varie
*** 1584,1601 ****
if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem))
return 0;
- base = find_base_term (x);
- if (base && (GET_CODE (base) == LABEL_REF
- || (GET_CODE (base) == SYMBOL_REF
- && CONSTANT_POOL_ADDRESS_P (base))))
- return 0;
-
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;
--- 1601,1618 ----
if (RTX_UNCHANGING_P (x) && ! RTX_UNCHANGING_P (mem))
return 0;
if (mem_mode == VOIDmode)
mem_mode = GET_MODE (mem);
x_addr = get_addr (XEXP (x, 0));
mem_addr = get_addr (XEXP (mem, 0));
+ base = find_base_term (x_addr);
+ if (base && (GET_CODE (base) == LABEL_REF
+ || (GET_CODE (base) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (base))))
+ return 0;
+
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;
*************** write_dependence_p (mem, x, writep)
*** 1645,1665 ****
/* If MEM is an unchanging read, then it can't possibly conflict with
the store to X, because there is at most one store to MEM, and it must
have occurred somewhere before MEM. */
if (! writep)
{
! if (RTX_UNCHANGING_P (mem))
! return 0;
!
! base = find_base_term (mem);
if (base && (GET_CODE (base) == LABEL_REF
|| (GET_CODE (base) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (base))))
return 0;
}
-
-
- x_addr = get_addr (XEXP (x, 0));
- mem_addr = get_addr (XEXP (mem, 0));
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x),
GET_MODE (mem)))
--- 1662,1681 ----
/* If MEM is an unchanging read, then it can't possibly conflict with
the store to X, because there is at most one store to MEM, and it must
have occurred somewhere before MEM. */
+ if (! writep && RTX_UNCHANGING_P (mem))
+ return 0;
+
+ x_addr = get_addr (XEXP (x, 0));
+ mem_addr = get_addr (XEXP (mem, 0));
+
if (! writep)
{
! base = find_base_term (mem_addr);
if (base && (GET_CODE (base) == LABEL_REF
|| (GET_CODE (base) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (base))))
return 0;
}
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x),
GET_MODE (mem)))
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------