alias.c (init_alias_analysis): Handle -fno-alias-check when optimizing correctly.

* alias.c (init_alias_analysis): Handle -fno-alias-check when
        optimizing correctly.

From-SVN: r16268
This commit is contained in:
Jeffrey A Law 1997-11-02 06:28:31 +00:00 committed by Jeff Law
parent 6cad9e3280
commit 8072f69c31
2 changed files with 56 additions and 45 deletions

View File

@ -9,6 +9,9 @@ Sat Nov 1 21:43:00 1997 Mike Stump (mrs@wrs.com)
Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com) Sat Nov 1 19:15:28 1997 Jeffrey A Law (law@cygnus.com)
* alias.c (init_alias_analysis): Handle -fno-alias-check when
optimizing correctly.
* expr.c (expand_builtin_setjmp): Don't emit a SETJMP note * expr.c (expand_builtin_setjmp): Don't emit a SETJMP note
or set current_function_calls_setjmp anymore. or set current_function_calls_setjmp anymore.

View File

@ -1002,12 +1002,6 @@ init_alias_analysis ()
/* Assume nothing will change this iteration of the loop. */ /* Assume nothing will change this iteration of the loop. */
changed = 0; changed = 0;
/* Wipe the potential alias information clean for this pass. */
bzero ((char *) new_reg_base_value, reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
bzero ((char *) reg_seen, reg_base_value_size);
/* We want to assign the same IDs each iteration of this loop, so /* We want to assign the same IDs each iteration of this loop, so
start counting from zero each iteration of the loop. */ start counting from zero each iteration of the loop. */
unique_id = 0; unique_id = 0;
@ -1016,6 +1010,17 @@ init_alias_analysis ()
loop, so we're copying arguments. */ loop, so we're copying arguments. */
copying_arguments = 1; copying_arguments = 1;
/* Only perform initialization of the arrays if we're actually
performing alias analysis. */
if (flag_alias_check)
{
/* Wipe the potential alias information clean for this pass. */
bzero ((char *) new_reg_base_value,
reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
bzero ((char *) reg_seen, reg_base_value_size);
/* Mark all hard registers which may contain an address. /* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address. The stack, frame and argument pointers may contain an address.
An argument register which can hold a Pmode value may contain An argument register which can hold a Pmode value may contain
@ -1030,7 +1035,8 @@ init_alias_analysis ()
/* Check whether this register can hold an incoming pointer /* Check whether this register can hold an incoming pointer
argument. FUNCTION_ARG_REGNO_P tests outgoing register argument. FUNCTION_ARG_REGNO_P tests outgoing register
numbers, so translate if necessary due to register windows. */ numbers, so translate if necessary due to register windows. */
if (FUNCTION_ARG_REGNO_P (OUTGOING_REGNO (i)) && HARD_REGNO_MODE_OK (i, Pmode)) if (FUNCTION_ARG_REGNO_P (OUTGOING_REGNO (i))
&& HARD_REGNO_MODE_OK (i, Pmode))
new_reg_base_value[i] = gen_rtx (ADDRESS, VOIDmode, new_reg_base_value[i] = gen_rtx (ADDRESS, VOIDmode,
gen_rtx (REG, Pmode, i)); gen_rtx (REG, Pmode, i));
@ -1053,6 +1059,7 @@ init_alias_analysis ()
&& GET_CODE (static_chain_rtx) == REG) && GET_CODE (static_chain_rtx) == REG)
new_reg_base_value[REGNO (static_chain_rtx)] new_reg_base_value[REGNO (static_chain_rtx)]
= gen_rtx (ADDRESS, Pmode, static_chain_rtx); = gen_rtx (ADDRESS, Pmode, static_chain_rtx);
}
/* Walk the insns adding values to the new_reg_base_value array. */ /* Walk the insns adding values to the new_reg_base_value array. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
@ -1089,6 +1096,7 @@ init_alias_analysis ()
} }
/* Now propagate values from new_reg_base_value to reg_base_value. */ /* Now propagate values from new_reg_base_value to reg_base_value. */
if (flag_alias_check)
for (i = 0; i < reg_base_value_size; i++) for (i = 0; i < reg_base_value_size; i++)
{ {
if (new_reg_base_value[i] if (new_reg_base_value[i]