Commit 624a8b3a by Jeffrey A Law Committed by Jeff Law

Makefile.in (LIB2FUNCS_EH): Define.

        * Makefile.in (LIB2FUNCS_EH): Define.  Just "_eh" for now.
        (LIBGCC2_CFLAGS): Remove -fexceptions.
        (LIB2FUNCS): Remove "_eh".
        (libgcc2.a): Iterate over LIB2FUNCS_EH and build everything in
        it with -fexceptions.
        * Makefile.in (local-alloc.o): Depend on insn-attr.h.
        * local-alloc.c (block_alloc): Avoid creating false
        dependencies for targets which use instruction scheduling.

From-SVN: r20370
parent 674576f1
Tue Jun 9 12:36:16 1998 Jeffrey A Law (law@cygnus.com)
* Makefile.in (LIB2FUNCS_EH): Define. Just "_eh" for now.
(LIBGCC2_CFLAGS): Remove -fexceptions.
(LIB2FUNCS): Remove "_eh".
(libgcc2.a): Iterate over LIB2FUNCS_EH and build everything in
it with -fexceptions.
* Makefile.in (local-alloc.o): Depend on insn-attr.h.
* local-alloc.c (block_alloc): Avoid creating false
dependencies for targets which use instruction scheduling.
Tue Jun 9 02:40:49 1998 Richard Henderson <rth@cygnus.com>
* mips/elf.h (ASM_DECLARE_OBJECT_NAME): Define.
......
......@@ -324,10 +324,8 @@ LIBGCC2 = libgcc2.a
# we use this here because that should be enough, and also
# so that -g1 will be tested.
#
# -fexceptions is necessary for eh.o now that the exceptions are
# the default for g++ only.
LIBGCC2_DEBUG_CFLAGS = -g1
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fexceptions @inhibit_libc@
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
# Additional options to use when compiling libgcc2.a.
# Some targets override this to -Iinclude
......@@ -689,7 +687,9 @@ LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_fixtfdi _fixunstfdi _floatditf \
__gcc_bcmp _varargs __dummy _eprintf \
_bb _shtab _clear_cache _trampoline __main _exit \
_ctors _eh _pure
_ctors _pure
LIB2FUNCS_EH = _eh
FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
_fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
......@@ -1020,6 +1020,15 @@ libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(FPBIT) $(DPBIT) $(LIB2ADD) \
$(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
rm -f $${name}$(objext); \
done
for name in $(LIB2FUNCS_EH); \
do \
echo $${name}; \
$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -fexceptions $(INCLUDES) -c \
-DL$${name} $(srcdir)/libgcc2.c -o $${name}$(objext); \
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
$(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
rm -f $${name}$(objext); \
done
if [ x$(FPBIT) != x ]; then \
for name in $(FPBIT_FUNCS); \
do \
......@@ -1431,7 +1440,8 @@ regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
$(BASIC_BLOCK_H) regs.h insn-config.h $(RECOG_H) reload.h real.h toplev.h \
output.h
local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
$(BASIC_BLOCK_H) regs.h hard-reg-set.h insn-config.h $(RECOG_H) output.h
$(BASIC_BLOCK_H) regs.h hard-reg-set.h insn-config.h $(RECOG_H) output.h \
insn-attr.h
bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
regs.h
global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h \
......
......@@ -67,6 +67,7 @@ Boston, MA 02111-1307, USA. */
#include "regs.h"
#include "hard-reg-set.h"
#include "insn-config.h"
#include "insn-attr.h"
#include "recog.h"
#include "output.h"
......@@ -1414,8 +1415,48 @@ block_alloc (b)
q = qty_order[i];
if (qty_phys_reg[q] < 0)
{
#ifdef INSN_SCHEDULING
/* These values represent the adjusted lifetime of a qty so
that it conflicts with qtys which appear near the start/end
of this qty's lifetime.
The purpose behind extending the lifetime of this qty is to
discourage the register allocator from creating false
dependencies.
The adjustment by the value +-3 indicates precisely that
this qty conflicts with qtys in the instructions immediately
before and after the lifetime of this qty.
Experiments have shown that higher values tend to hurt
overall code performance.
If allocation using the extended lifetime fails we will try
again with the qty's unadjusted lifetime. */
int fake_birth = MAX (0, qty_birth[q] - 3);
int fake_death = MIN (insn_number * 2 + 1, qty_death[q] + 3);
#endif
if (N_REG_CLASSES > 1)
{
#ifdef INSN_SCHEDULING
/* We try to avoid using hard registers allocated to qtys which
are born immediately after this qty or die immediately before
this qty.
This optimization is only appropriate when we will run
a scheduling pass after reload and we are not optimizing
for code size. */
if (flag_schedule_insns_after_reload && !optimize_size)
{
qty_phys_reg[q] = find_free_reg (qty_min_class[q],
qty_mode[q], q, 0, 0,
fake_birth, fake_death);
if (qty_phys_reg[q] >= 0)
continue;
}
#endif
qty_phys_reg[q] = find_free_reg (qty_min_class[q],
qty_mode[q], q, 0, 0,
qty_birth[q], qty_death[q]);
......@@ -1423,6 +1464,14 @@ block_alloc (b)
continue;
}
#ifdef INSN_SCHEDULING
/* Similarly, avoid false dependencies. */
if (flag_schedule_insns_after_reload && !optimize_size
&& qty_alternate_class[q] != NO_REGS)
qty_phys_reg[q] = find_free_reg (qty_alternate_class[q],
qty_mode[q], q, 0, 0,
fake_birth, fake_death);
#endif
if (qty_alternate_class[q] != NO_REGS)
qty_phys_reg[q] = find_free_reg (qty_alternate_class[q],
qty_mode[q], q, 0, 0,
......
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