+2007-12-03 Steven Bosscher <stevenb.gcc@gmail.com>
+
+ PR33713
+ * doc/invoke.texi: Remove -fforce-addr documentation.
+ * expr.c (emit_move_insn): Remove use of flag_force_addr.
+ (expand_expr_real_1): Same.
+ (do_tablejump): Same.
+ Call memory_address instead of memory_address_noforce.
+ * expr.h (memory_address_noforce): Remove prototype.
+ * explow.c (memory_address): Remove support for flag_force_addr.
+ (validize_mem): Same.
+ (memory_address_noforce): Remove.
+ * common.opt: Add dummy documentation for -fforce-addr.
+ * combine.c (can_combine_p): Remove -fforce-addr comment.
+ * config/cris/cris.h (OPTIMIZATION_OPTIONS): Remove set of
+ flag_force_addr.
+ * config/m68k/m68k.h (PIC_CASE_VECTOR_ADDRESS): Remove comment
+ relating to memory_address_noforce.
+ * testsuite/gcc.c-torture/compile/20050802-1.c: Remove.
+ * testsuite/gcc.c-torture/compile/20011113-1.c: Remove.
+
2007-12-03 Jakub Jelinek <jakub@redhat.com>
* omp-low.c (lookup_decl_in_outer_ctx): Allow calling this
change whether the life span of some REGs crosses calls or not,
and it is a pain to update that information.
Exception: if source is a constant, moving it later can't hurt.
- Accept that special case, because it helps -fforce-addr a lot. */
+ Accept that as a special case. */
|| (DF_INSN_LUID (insn) < last_call_luid && ! CONSTANT_P (src)))
return 0;
Common Report Var(flag_float_store) Optimization
Don't allocate floats and doubles in extended-precision registers
-; Nonzero for -fforce-addr: load memory address into a register before
-; reference to memory. This makes better cse but slower compilation.
fforce-addr
-Common Report Var(flag_force_addr) Optimization
-Copy memory address constants into registers before use
+Common
+Does nothing. Preserved for backward compatibility.
fforward-propagate
Common Report Var(flag_forward_propagate) Optimization
do \
{ \
if ((OPTIMIZE) >= 2 || (SIZE)) \
- { \
- flag_force_addr = 1; \
- flag_omit_frame_pointer = 1; \
- } \
+ flag_omit_frame_pointer = 1; \
} \
while (0)
} \
while (0)
-/* Don't call memory_address_noforce for the address to fetch
- the switch offset. This address is ok as it stands,
- but memory_address_noforce would alter it. */
+/* This address is OK as it stands. */
#define PIC_CASE_VECTOR_ADDRESS(index) index
\f
/* For the 68000, we handle X+REG by loading X into a register R and
-fcse-skip-blocks -fcx-limited-range -fdata-sections -fdce -fdce @gol
-fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
-fearly-inlining -fexpensive-optimizations -ffast-math @gol
--ffinite-math-only -ffloat-store -fforce-addr -fforward-propagate @gol
+-ffinite-math-only -ffloat-store -fforward-propagate @gol
-ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
-fgcse-sm -fif-conversion -fif-conversion2 -finline-functions @gol
-finline-functions-called-once -finline-limit=@var{n} @gol
Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
-@item -fforce-addr
-@opindex fforce-addr
-Force memory address constants to be copied into registers before
-doing arithmetic on them.
-
@item -fforward-propagate
@opindex fforward-propagate
Perform a forward propagation pass on RTL. The pass tries to combine two
/* At this point, any valid address is accepted. */
if (memory_address_p (mode, x))
- goto win;
+ goto done;
/* If it was valid before but breaking out memory refs invalidated it,
use it the old way. */
if (memory_address_p (mode, oldx))
- goto win2;
+ {
+ x = oldx;
+ goto done;
+ }
/* Perform machine-dependent transformations on X
in certain cases. This is not necessary since the code
below can handle all possible cases, but machine-dependent
transformations can make better code. */
- LEGITIMIZE_ADDRESS (x, oldx, mode, win);
+ LEGITIMIZE_ADDRESS (x, oldx, mode, done);
/* PLUS and MULT can appear in special ways
as the result of attempts to make an address usable for indexing.
the register is a valid address. */
else
x = force_reg (Pmode, x);
-
- goto done;
-
- win2:
- x = oldx;
- win:
- if (flag_force_addr && ! cse_not_expected && !REG_P (x))
- {
- x = force_operand (x, NULL_RTX);
- x = force_reg (Pmode, x);
- }
}
done:
return x;
}
-/* Like `memory_address' but pretend `flag_force_addr' is 0. */
-
-rtx
-memory_address_noforce (enum machine_mode mode, rtx x)
-{
- int ambient_force_addr = flag_force_addr;
- rtx val;
-
- flag_force_addr = 0;
- val = memory_address (mode, x);
- flag_force_addr = ambient_force_addr;
- return val;
-}
-
/* Convert a mem ref into one with a valid memory address.
Pass through anything else unchanged. */
if (!MEM_P (ref))
return ref;
ref = use_anchored_address (ref);
- if (! (flag_force_addr && CONSTANT_ADDRESS_P (XEXP (ref, 0)))
- && memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+ if (memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
return ref;
/* Don't alter REF itself, since that is probably a stack slot. */
/* If X or Y are memory references, verify that their addresses are valid
for the machine. */
if (MEM_P (x)
- && ((! memory_address_p (GET_MODE (x), XEXP (x, 0))
- && ! push_operand (x, GET_MODE (x)))
- || (flag_force_addr
- && CONSTANT_ADDRESS_P (XEXP (x, 0)))))
+ && (! memory_address_p (GET_MODE (x), XEXP (x, 0))
+ && ! push_operand (x, GET_MODE (x))))
x = validize_mem (x);
if (MEM_P (y)
- && (! memory_address_p (GET_MODE (y), XEXP (y, 0))
- || (flag_force_addr
- && CONSTANT_ADDRESS_P (XEXP (y, 0)))))
+ && ! memory_address_p (GET_MODE (y), XEXP (y, 0)))
y = validize_mem (y);
gcc_assert (mode != BLKmode);
if (MEM_P (decl_rtl) && REG_P (XEXP (decl_rtl, 0)))
temp = validize_mem (decl_rtl);
- /* If DECL_RTL is memory, we are in the normal case and either
- the address is not valid or it is not a register and -fforce-addr
- is specified, get the address into a register. */
+ /* If DECL_RTL is memory, we are in the normal case and the
+ address is not valid, get the address into a register. */
else if (MEM_P (decl_rtl) && modifier != EXPAND_INITIALIZER)
{
decl_rtl = use_anchored_address (decl_rtl);
if (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_SUM
- && (!memory_address_p (DECL_MODE (exp), XEXP (decl_rtl, 0))
- || (flag_force_addr && !REG_P (XEXP (decl_rtl, 0)))))
+ && !memory_address_p (DECL_MODE (exp), XEXP (decl_rtl, 0)))
temp = replace_equiv_address (decl_rtl,
copy_rtx (XEXP (decl_rtl, 0)));
}
if (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_INITIALIZER
&& modifier != EXPAND_SUM
- && (! memory_address_p (mode, XEXP (temp, 0))
- || flag_force_addr))
+ && ! memory_address_p (mode, XEXP (temp, 0)))
return replace_equiv_address (temp,
copy_rtx (XEXP (temp, 0)));
return temp;
index = copy_to_mode_reg (Pmode, index);
#endif
- /* If flag_force_addr were to affect this address
- it could interfere with the tricky assumptions made
- about addresses that contain label-refs,
- which may be valid only very near the tablejump itself. */
/* ??? The only correct use of CASE_VECTOR_MODE is the one inside the
GET_MODE_SIZE, because this indicates how large insns are. The other
uses should all be Pmode, because they are addresses. This code
index = PIC_CASE_VECTOR_ADDRESS (index);
else
#endif
- index = memory_address_noforce (CASE_VECTOR_MODE, index);
+ index = memory_address (CASE_VECTOR_MODE, index);
temp = gen_reg_rtx (CASE_VECTOR_MODE);
vector = gen_const_mem (CASE_VECTOR_MODE, index);
convert_move (temp, vector, 0);
by emitting insns to perform arithmetic if nec. */
extern rtx memory_address (enum machine_mode, rtx);
-/* Like `memory_address' but pretend `flag_force_addr' is 0. */
-extern rtx memory_address_noforce (enum machine_mode, rtx);
-
/* Return a memory reference like MEMREF, but with its mode changed
to MODE and its address changed to ADDR.
(VOIDmode means don't change the mode.
+++ /dev/null
-/* PR 23196 */
-/* { dg-options "-fforce-addr" } */
-
-void foo()
-{
- char c;
-
- c |= 1;
- bar(&c);
-}
+++ /dev/null
-/* Copyright (C) 2001 Free Software Foundation.
- by Hans-Peter Nilsson <hp@axis.com> */
-
-/* { dg-do compile } */
-/* { dg-options "-O2 -fforce-addr" } */
-
-const char foo[] = "fum";
-const struct fi
-{
- const char *const in;
- const char *const out;
- const int flags;
-} fie[] = {
- {"nw", " new", 0},
- {"dl", foo, 1}
-};