Commit b3b5ad95 by Jeffrey A Law Committed by Jeff Law

alias.c: Update comments for ADDRESS.

        * alias.c: Update comments for ADDRESS.
        (nonlocal_reference_p): Look inside the ADDRESS to determine if
        it is a local memory reference.

From-SVN: r30210
parent c831fdea
...@@ -4,6 +4,10 @@ Tue Oct 26 23:15:03 1999 Mark Mitchell <mark@codesourcery.com> ...@@ -4,6 +4,10 @@ Tue Oct 26 23:15:03 1999 Mark Mitchell <mark@codesourcery.com>
Tue Oct 26 23:29:18 1999 Jeffrey A Law (law@cygnus.com) Tue Oct 26 23:29:18 1999 Jeffrey A Law (law@cygnus.com)
* alias.c: Update comments for ADDRESS.
(nonlocal_reference_p): Look inside the ADDRESS to determine if
it is a local memory reference.
* c-typeck.c (build_function_call): Check that the built-in * c-typeck.c (build_function_call): Check that the built-in
function is of class BUILT_IN_NORMAL before trying to recongize function is of class BUILT_IN_NORMAL before trying to recongize
it as BUILT_IN_ABS. it as BUILT_IN_ABS.
......
...@@ -121,12 +121,16 @@ static int nonlocal_reference_p PROTO((rtx)); ...@@ -121,12 +121,16 @@ static int nonlocal_reference_p PROTO((rtx));
A base address can be an ADDRESS, SYMBOL_REF, or LABEL_REF. ADDRESS A base address can be an ADDRESS, SYMBOL_REF, or LABEL_REF. ADDRESS
expressions represent certain special values: function arguments and expressions represent certain special values: function arguments and
the stack, frame, and argument pointers. The contents of an address the stack, frame, and argument pointers.
expression are not used (but they are descriptive for debugging);
only the address and mode matter. Pointer equality, not rtx_equal_p, The contents of an ADDRESS is not normally used, the mode of the
determines whether two ADDRESS expressions refer to the same base ADDRESS determines whether the ADDRESS is a function argument or some
address. The mode determines whether it is a function argument or other special value. Pointer equality, not rtx_equal_p, determines whether
other special value. */ two ADDRESS expressions refer to the same base address.
The only use of the contents of an ADDRESS is for determining if the
current function performs nonlocal memory memory references for the
purposes of marking the function as a constant function. */
static rtx *reg_base_value; static rtx *reg_base_value;
static rtx *new_reg_base_value; static rtx *new_reg_base_value;
...@@ -1422,8 +1426,19 @@ nonlocal_reference_p (x) ...@@ -1422,8 +1426,19 @@ nonlocal_reference_p (x)
base = find_base_term (XEXP (x, 0)); base = find_base_term (XEXP (x, 0));
if (base) if (base)
{ {
/* Stack references are local. */ /* A Pmode ADDRESS could be a reference via the structure value
if (GET_CODE (base) == ADDRESS && GET_MODE (base) == Pmode) address or static chain. Such memory references are nonlocal.
Thus, we have to examine the contents of the ADDRESS to find
out if this is a local reference or not. */
if (GET_CODE (base) == ADDRESS
&& GET_MODE (base) == Pmode
&& (XEXP (base, 0) == stack_pointer_rtx
|| XEXP (base, 0) == arg_pointer_rtx
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
|| XEXP (base, 0) == hard_frame_pointer_rtx
#endif
|| XEXP (base, 0) == frame_pointer_rtx))
return 0; return 0;
/* Constants in the function's constant pool are constant. */ /* Constants in the function's constant pool are constant. */
if (GET_CODE (base) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (base)) if (GET_CODE (base) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (base))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment