summaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-10 15:13:54 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-10 15:13:54 +0000
commit8cff878b277f9af6c2827a87581baac5f768e12a (patch)
treed4e178503efd243eed24ff3b753cd998370d75d4 /gcc/df-scan.c
parent9610b14f8599a9db94822d3f0923b58b2f1177dc (diff)
downloadgcc-8cff878b277f9af6c2827a87581baac5f768e12a.tar.gz
[./]
2016-02-10 Basile Starynkevitch <basile@starynkevitch.net> {{merging with some of GCC 6, using svn merge -r222130:226090 ^/trunk ; UNSTABLE}} [gcc/] 2016-02-10 Basile Starynkevitch <basile@starynkevitch.net> {{ merging with trunk 226090 ; UNSTABLE }} * melt-run.proto.h: include tree-ssa-scopedtables.h * tree-ssa-dom.c: skip second record_edge_info git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@233272 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c272
1 files changed, 106 insertions, 166 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 1700be99805..93c2eae3e02 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -24,58 +24,25 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
+#include "backend.h"
+#include "tree.h"
#include "rtl.h"
+#include "df.h"
#include "tm_p.h"
#include "insn-config.h"
#include "recog.h"
-#include "hashtab.h"
-#include "hash-set.h"
-#include "machmode.h"
-#include "vec.h"
-#include "double-int.h"
-#include "input.h"
#include "alias.h"
-#include "symtab.h"
-#include "wide-int.h"
-#include "inchash.h"
-#include "hard-reg-set.h"
-#include "input.h"
-#include "function.h"
#include "regs.h"
#include "alloc-pool.h"
#include "flags.h"
-#include "predict.h"
-#include "dominance.h"
-#include "cfg.h"
-#include "basic-block.h"
-#include "sbitmap.h"
-#include "bitmap.h"
#include "dumpfile.h"
-#include "tree.h"
#include "target.h"
-#include "target-def.h"
-#include "df.h"
#include "emit-rtl.h" /* FIXME: Can go away once crtl is moved to rtl.h. */
typedef struct df_mw_hardreg *df_mw_hardreg_ptr;
-#ifndef HAVE_epilogue
-#define HAVE_epilogue 0
-#endif
-#ifndef HAVE_prologue
-#define HAVE_prologue 0
-#endif
-#ifndef HAVE_sibcall_epilogue
-#define HAVE_sibcall_epilogue 0
-#endif
-
-#ifndef EPILOGUE_USES
-#define EPILOGUE_USES(REGNO) 0
-#endif
-
/* The set of hard registers in eliminables[i].from. */
static HARD_REG_SET elim_reg_set;
@@ -166,15 +133,18 @@ static const unsigned int copy_all = copy_defs | copy_uses | copy_eq_uses
it gets run. It also has no need for the iterative solver.
----------------------------------------------------------------------------*/
+#define SCAN_PROBLEM_DATA_BLOCK_SIZE 512
+
/* Problem data for the scanning dataflow function. */
struct df_scan_problem_data
{
- alloc_pool ref_base_pool;
- alloc_pool ref_artificial_pool;
- alloc_pool ref_regular_pool;
- alloc_pool insn_pool;
- alloc_pool reg_pool;
- alloc_pool mw_reg_pool;
+ object_allocator<df_base_ref> *ref_base_pool;
+ object_allocator<df_artificial_ref> *ref_artificial_pool;
+ object_allocator<df_regular_ref> *ref_regular_pool;
+ object_allocator<df_insn_info> *insn_pool;
+ object_allocator<df_reg_info> *reg_pool;
+ object_allocator<df_mw_hardreg> *mw_reg_pool;
+
bitmap_obstack reg_bitmaps;
bitmap_obstack insn_bitmaps;
};
@@ -225,12 +195,12 @@ df_scan_free_internal (void)
bitmap_clear (&df->insns_to_rescan);
bitmap_clear (&df->insns_to_notes_rescan);
- free_alloc_pool (problem_data->ref_base_pool);
- free_alloc_pool (problem_data->ref_artificial_pool);
- free_alloc_pool (problem_data->ref_regular_pool);
- free_alloc_pool (problem_data->insn_pool);
- free_alloc_pool (problem_data->reg_pool);
- free_alloc_pool (problem_data->mw_reg_pool);
+ delete problem_data->ref_base_pool;
+ delete problem_data->ref_artificial_pool;
+ delete problem_data->ref_regular_pool;
+ delete problem_data->insn_pool;
+ delete problem_data->reg_pool;
+ delete problem_data->mw_reg_pool;
bitmap_obstack_release (&problem_data->reg_bitmaps);
bitmap_obstack_release (&problem_data->insn_bitmaps);
free (df_scan->problem_data);
@@ -271,7 +241,6 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
{
struct df_scan_problem_data *problem_data;
unsigned int insn_num = get_max_uid () + 1;
- unsigned int block_size = 512;
basic_block bb;
/* Given the number of pools, this is really faster than tearing
@@ -283,24 +252,18 @@ df_scan_alloc (bitmap all_blocks ATTRIBUTE_UNUSED)
df_scan->problem_data = problem_data;
df_scan->computed = true;
- problem_data->ref_base_pool
- = create_alloc_pool ("df_scan ref base",
- sizeof (struct df_base_ref), block_size);
- problem_data->ref_artificial_pool
- = create_alloc_pool ("df_scan ref artificial",
- sizeof (struct df_artificial_ref), block_size);
- problem_data->ref_regular_pool
- = create_alloc_pool ("df_scan ref regular",
- sizeof (struct df_regular_ref), block_size);
- problem_data->insn_pool
- = create_alloc_pool ("df_scan insn",
- sizeof (struct df_insn_info), block_size);
- problem_data->reg_pool
- = create_alloc_pool ("df_scan reg",
- sizeof (struct df_reg_info), block_size);
- problem_data->mw_reg_pool
- = create_alloc_pool ("df_scan mw_reg",
- sizeof (struct df_mw_hardreg), block_size / 16);
+ problem_data->ref_base_pool = new object_allocator<df_base_ref>
+ ("df_scan ref base", SCAN_PROBLEM_DATA_BLOCK_SIZE);
+ problem_data->ref_artificial_pool = new object_allocator<df_artificial_ref>
+ ("df_scan ref artificial", SCAN_PROBLEM_DATA_BLOCK_SIZE);
+ problem_data->ref_regular_pool = new object_allocator<df_regular_ref>
+ ("df_scan ref regular", SCAN_PROBLEM_DATA_BLOCK_SIZE);
+ problem_data->insn_pool = new object_allocator<df_insn_info>
+ ("df_scan insn", SCAN_PROBLEM_DATA_BLOCK_SIZE);
+ problem_data->reg_pool = new object_allocator<df_reg_info>
+ ("df_scan reg", SCAN_PROBLEM_DATA_BLOCK_SIZE);
+ problem_data->mw_reg_pool = new object_allocator<df_mw_hardreg>
+ ("df_scan mw_reg", SCAN_PROBLEM_DATA_BLOCK_SIZE / 16);
bitmap_obstack_initialize (&problem_data->reg_bitmaps);
bitmap_obstack_initialize (&problem_data->insn_bitmaps);
@@ -376,7 +339,7 @@ df_scan_start_dump (FILE *file ATTRIBUTE_UNUSED)
fprintf (file, ";; regs ever live \t");
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (df_regs_ever_live_p (i))
- fprintf (file, " %d[%s]", i, reg_names[i]);
+ fprintf (file, " %d [%s]", i, reg_names[i]);
fprintf (file, "\n;; ref usage \t");
for (i = 0; i < (int)df->regs_inited; i++)
@@ -526,13 +489,14 @@ df_grow_reg_info (void)
{
struct df_reg_info *reg_info;
- reg_info = (struct df_reg_info *) pool_alloc (problem_data->reg_pool);
+ // TODO
+ reg_info = problem_data->reg_pool->allocate ();
memset (reg_info, 0, sizeof (struct df_reg_info));
df->def_regs[i] = reg_info;
- reg_info = (struct df_reg_info *) pool_alloc (problem_data->reg_pool);
+ reg_info = problem_data->reg_pool->allocate ();
memset (reg_info, 0, sizeof (struct df_reg_info));
df->use_regs[i] = reg_info;
- reg_info = (struct df_reg_info *) pool_alloc (problem_data->reg_pool);
+ reg_info = problem_data->reg_pool->allocate ();
memset (reg_info, 0, sizeof (struct df_reg_info));
df->eq_use_regs[i] = reg_info;
df->def_info.begin[i] = 0;
@@ -747,15 +711,17 @@ df_free_ref (df_ref ref)
switch (DF_REF_CLASS (ref))
{
case DF_REF_BASE:
- pool_free (problem_data->ref_base_pool, ref);
+ problem_data->ref_base_pool->remove ((df_base_ref *) (ref));
break;
case DF_REF_ARTIFICIAL:
- pool_free (problem_data->ref_artificial_pool, ref);
+ problem_data->ref_artificial_pool->remove
+ ((df_artificial_ref *) (ref));
break;
case DF_REF_REGULAR:
- pool_free (problem_data->ref_regular_pool, ref);
+ problem_data->ref_regular_pool->remove
+ ((df_regular_ref *) (ref));
break;
}
}
@@ -858,7 +824,7 @@ df_insn_create_insn_record (rtx_insn *insn)
insn_rec = DF_INSN_INFO_GET (insn);
if (!insn_rec)
{
- insn_rec = (struct df_insn_info *) pool_alloc (problem_data->insn_pool);
+ insn_rec = problem_data->insn_pool->allocate ();
DF_INSN_INFO_SET (insn, insn_rec);
}
memset (insn_rec, 0, sizeof (struct df_insn_info));
@@ -906,7 +872,7 @@ df_mw_hardreg_chain_delete (struct df_mw_hardreg *hardregs)
for (; hardregs; hardregs = next)
{
next = DF_MWS_NEXT (hardregs);
- pool_free (problem_data->mw_reg_pool, hardregs);
+ problem_data->mw_reg_pool->remove (hardregs);
}
}
@@ -947,7 +913,7 @@ df_insn_info_delete (unsigned int uid)
df_ref_chain_delete (insn_info->uses);
df_ref_chain_delete (insn_info->eq_uses);
- pool_free (problem_data->insn_pool, insn_info);
+ problem_data->insn_pool->remove (insn_info);
DF_INSN_UID_SET (uid, NULL);
}
}
@@ -1031,7 +997,7 @@ df_free_collection_rec (struct df_collection_rec *collection_rec)
FOR_EACH_VEC_ELT (collection_rec->eq_use_vec, ix, ref)
df_free_ref (ref);
FOR_EACH_VEC_ELT (collection_rec->mw_vec, ix, mw)
- pool_free (problem_data->mw_reg_pool, mw);
+ problem_data->mw_reg_pool->remove (mw);
collection_rec->def_vec.release ();
collection_rec->use_vec.release ();
@@ -1826,7 +1792,7 @@ df_insn_change_bb (rtx_insn *insn, basic_block new_bb)
static void
df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
struct df_reg_info *new_df,
- int new_regno, rtx loc)
+ unsigned int new_regno, rtx loc)
{
df_ref the_ref = old_df->reg_chain;
@@ -1911,25 +1877,33 @@ df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
}
-/* Change the regno of all refs that contained LOC from OLD_REGNO to
- NEW_REGNO. Refs that do not match LOC are not changed which means
- that artificial refs are not changed since they have no loc. This
- call is to support the SET_REGNO macro. */
+/* Change the regno of register LOC to NEW_REGNO and update the df
+ information accordingly. Refs that do not match LOC are not changed
+ which means that artificial refs are not changed since they have no loc.
+ This call is to support the SET_REGNO macro. */
void
-df_ref_change_reg_with_loc (int old_regno, int new_regno, rtx loc)
+df_ref_change_reg_with_loc (rtx loc, unsigned int new_regno)
{
- if ((!df) || (old_regno == -1) || (old_regno == new_regno))
+ unsigned int old_regno = REGNO (loc);
+ if (old_regno == new_regno)
return;
- df_grow_reg_info ();
-
- df_ref_change_reg_with_loc_1 (DF_REG_DEF_GET (old_regno),
- DF_REG_DEF_GET (new_regno), new_regno, loc);
- df_ref_change_reg_with_loc_1 (DF_REG_USE_GET (old_regno),
- DF_REG_USE_GET (new_regno), new_regno, loc);
- df_ref_change_reg_with_loc_1 (DF_REG_EQ_USE_GET (old_regno),
- DF_REG_EQ_USE_GET (new_regno), new_regno, loc);
+ if (df)
+ {
+ df_grow_reg_info ();
+
+ df_ref_change_reg_with_loc_1 (DF_REG_DEF_GET (old_regno),
+ DF_REG_DEF_GET (new_regno),
+ new_regno, loc);
+ df_ref_change_reg_with_loc_1 (DF_REG_USE_GET (old_regno),
+ DF_REG_USE_GET (new_regno),
+ new_regno, loc);
+ df_ref_change_reg_with_loc_1 (DF_REG_EQ_USE_GET (old_regno),
+ DF_REG_EQ_USE_GET (new_regno),
+ new_regno, loc);
+ }
+ set_mode_and_regno (loc, GET_MODE (loc), new_regno);
}
@@ -1948,7 +1922,7 @@ df_mw_hardreg_chain_delete_eq_uses (struct df_insn_info *insn_info)
if (mw->flags & DF_REF_IN_NOTE)
{
*mw_ptr = DF_MWS_NEXT (mw);
- pool_free (problem_data->mw_reg_pool, mw);
+ problem_data->mw_reg_pool->remove (mw);
}
else
mw_ptr = &DF_MWS_NEXT (mw);
@@ -2142,14 +2116,6 @@ df_ref_ptr_compare (const void *r1, const void *r2)
return df_ref_compare (*(const df_ref *) r1, *(const df_ref *) r2);
}
-static void
-df_swap_refs (vec<df_ref, va_heap> *ref_vec, int i, int j)
-{
- df_ref tmp = (*ref_vec)[i];
- (*ref_vec)[i] = (*ref_vec)[j];
- (*ref_vec)[j] = tmp;
-}
-
/* Sort and compress a set of refs. */
static void
@@ -2169,7 +2135,7 @@ df_sort_and_compress_refs (vec<df_ref, va_heap> *ref_vec)
df_ref r0 = (*ref_vec)[0];
df_ref r1 = (*ref_vec)[1];
if (df_ref_compare (r0, r1) > 0)
- df_swap_refs (ref_vec, 0, 1);
+ std::swap ((*ref_vec)[0], (*ref_vec)[1]);
}
else
{
@@ -2295,8 +2261,7 @@ df_sort_and_compress_mws (vec<df_mw_hardreg_ptr, va_heap> *mw_vec)
while (i + dist + 1 < count
&& df_mw_equal_p ((*mw_vec)[i], (*mw_vec)[i + dist + 1]))
{
- pool_free (problem_data->mw_reg_pool,
- (*mw_vec)[i + dist + 1]);
+ problem_data->mw_reg_pool->remove ((*mw_vec)[i + dist + 1]);
dist++;
}
/* Copy it down to the next position. */
@@ -2524,18 +2489,18 @@ df_ref_create_structure (enum df_ref_class cl,
switch (cl)
{
case DF_REF_BASE:
- this_ref = (df_ref) pool_alloc (problem_data->ref_base_pool);
+ this_ref = (df_ref) (problem_data->ref_base_pool->allocate ());
gcc_checking_assert (loc == NULL);
break;
case DF_REF_ARTIFICIAL:
- this_ref = (df_ref) pool_alloc (problem_data->ref_artificial_pool);
+ this_ref = (df_ref) (problem_data->ref_artificial_pool->allocate ());
this_ref->artificial_ref.bb = bb;
gcc_checking_assert (loc == NULL);
break;
case DF_REF_REGULAR:
- this_ref = (df_ref) pool_alloc (problem_data->ref_regular_pool);
+ this_ref = (df_ref) (problem_data->ref_regular_pool->allocate ());
this_ref->regular_ref.loc = loc;
gcc_checking_assert (loc);
break;
@@ -2623,7 +2588,7 @@ df_ref_record (enum df_ref_class cl,
endregno = regno + subreg_nregs (reg);
}
else
- endregno = END_HARD_REGNO (reg);
+ endregno = END_REGNO (reg);
/* If this is a multiword hardreg, we create some extra
datastructures that will enable us to easily build REG_DEAD
@@ -2637,7 +2602,7 @@ df_ref_record (enum df_ref_class cl,
ref_flags |= DF_REF_PARTIAL;
ref_flags |= DF_REF_MW_HARDREG;
- hardreg = (struct df_mw_hardreg *) pool_alloc (problem_data->mw_reg_pool);
+ hardreg = problem_data->mw_reg_pool->allocate ();
hardreg->type = ref_type;
hardreg->flags = ref_flags;
hardreg->mw_reg = reg;
@@ -3247,12 +3212,11 @@ df_insn_refs_collect (struct df_collection_rec *collection_rec,
regno_reg_rtx[FRAME_POINTER_REGNUM],
NULL, bb, insn_info,
DF_REF_REG_USE, 0);
-#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
- df_ref_record (DF_REF_BASE, collection_rec,
- regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
- NULL, bb, insn_info,
- DF_REF_REG_USE, 0);
-#endif
+ if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
+ df_ref_record (DF_REF_BASE, collection_rec,
+ regno_reg_rtx[HARD_FRAME_POINTER_REGNUM],
+ NULL, bb, insn_info,
+ DF_REF_REG_USE, 0);
break;
default:
break;
@@ -3332,7 +3296,6 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
return;
}
-#ifdef EH_RETURN_DATA_REGNO
if (bb_has_eh_pred (bb))
{
unsigned int i;
@@ -3346,7 +3309,6 @@ df_bb_refs_collect (struct df_collection_rec *collection_rec, basic_block bb)
bb, NULL, DF_REF_REG_DEF, DF_REF_AT_TOP);
}
}
-#endif
/* Add the hard_frame_pointer if this block is the target of a
non-local goto. */
@@ -3444,16 +3406,15 @@ df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses)
reference of the frame pointer. */
bitmap_set_bit (regular_block_artificial_uses, FRAME_POINTER_REGNUM);
-#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
- bitmap_set_bit (regular_block_artificial_uses, HARD_FRAME_POINTER_REGNUM);
-#endif
+ if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
+ bitmap_set_bit (regular_block_artificial_uses,
+ HARD_FRAME_POINTER_REGNUM);
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */
- if (fixed_regs[ARG_POINTER_REGNUM])
+ if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ && fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (regular_block_artificial_uses, ARG_POINTER_REGNUM);
-#endif
/* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */
@@ -3496,14 +3457,13 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses)
if (frame_pointer_needed)
{
bitmap_set_bit (eh_block_artificial_uses, FRAME_POINTER_REGNUM);
-#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
- bitmap_set_bit (eh_block_artificial_uses, HARD_FRAME_POINTER_REGNUM);
-#endif
+ if (!HARD_FRAME_POINTER_IS_FRAME_POINTER)
+ bitmap_set_bit (eh_block_artificial_uses,
+ HARD_FRAME_POINTER_REGNUM);
}
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- if (fixed_regs[ARG_POINTER_REGNUM])
+ if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ && fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (eh_block_artificial_uses, ARG_POINTER_REGNUM);
-#endif
}
}
@@ -3520,18 +3480,7 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses)
static void
df_mark_reg (rtx reg, void *vset)
{
- bitmap set = (bitmap) vset;
- int regno = REGNO (reg);
-
- gcc_assert (GET_MODE (reg) != BLKmode);
-
- if (regno < FIRST_PSEUDO_REGISTER)
- {
- int n = hard_regno_nregs[regno][GET_MODE (reg)];
- bitmap_set_range (set, regno, n);
- }
- else
- bitmap_set_bit (set, regno);
+ bitmap_set_range ((bitmap) vset, REGNO (reg), REG_NREGS (reg));
}
@@ -3558,7 +3507,7 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
/* Once the prologue has been generated, all of these registers
should just show up in the first regular block. */
- if (HAVE_prologue && epilogue_completed)
+ if (targetm.have_prologue () && epilogue_completed)
{
/* Defs for the callee saved registers are inserted so that the
pushes have some defining location. */
@@ -3582,34 +3531,28 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
/* Any reference to any pseudo before reload is a potential
reference of the frame pointer. */
bitmap_set_bit (entry_block_defs, FRAME_POINTER_REGNUM);
-#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
+
/* If they are different, also mark the hard frame pointer as live. */
- if (!LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
+ if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
+ && !LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
bitmap_set_bit (entry_block_defs, HARD_FRAME_POINTER_REGNUM);
-#endif
}
/* These registers are live everywhere. */
if (!reload_completed)
{
-#ifdef PIC_OFFSET_TABLE_REGNUM
- unsigned int picreg = PIC_OFFSET_TABLE_REGNUM;
-#endif
-
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */
- if (fixed_regs[ARG_POINTER_REGNUM])
+ if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ && fixed_regs[ARG_POINTER_REGNUM])
bitmap_set_bit (entry_block_defs, ARG_POINTER_REGNUM);
-#endif
-#ifdef PIC_OFFSET_TABLE_REGNUM
/* Any constant, or pseudo with constant equivalences, may
require reloading from memory using the pic register. */
+ unsigned int picreg = PIC_OFFSET_TABLE_REGNUM;
if (picreg != INVALID_REGNUM
&& fixed_regs[picreg])
bitmap_set_bit (entry_block_defs, picreg);
-#endif
}
#ifdef INCOMING_RETURN_ADDR_RTX
@@ -3720,11 +3663,11 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
if ((!reload_completed) || frame_pointer_needed)
{
bitmap_set_bit (exit_block_uses, FRAME_POINTER_REGNUM);
-#if !HARD_FRAME_POINTER_IS_FRAME_POINTER
+
/* If they are different, also mark the hard frame pointer as live. */
- if (!LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
+ if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
+ && !LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM))
bitmap_set_bit (exit_block_uses, HARD_FRAME_POINTER_REGNUM);
-#endif
}
/* Many architectures have a GP register even without flag_pic.
@@ -3742,7 +3685,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
if (global_regs[i] || EPILOGUE_USES (i))
bitmap_set_bit (exit_block_uses, i);
- if (HAVE_epilogue && epilogue_completed)
+ if (targetm.have_epilogue () && epilogue_completed)
{
/* Mark all call-saved registers that we actually used. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
@@ -3751,7 +3694,6 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
bitmap_set_bit (exit_block_uses, i);
}
-#ifdef EH_RETURN_DATA_REGNO
/* Mark the registers that will contain data for the handler. */
if (reload_completed && crtl->calls_eh_return)
for (i = 0; ; ++i)
@@ -3761,10 +3703,9 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
break;
bitmap_set_bit (exit_block_uses, regno);
}
-#endif
#ifdef EH_RETURN_STACKADJ_RTX
- if ((!HAVE_epilogue || ! epilogue_completed)
+ if ((!targetm.have_epilogue () || ! epilogue_completed)
&& crtl->calls_eh_return)
{
rtx tmp = EH_RETURN_STACKADJ_RTX;
@@ -3774,7 +3715,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
#endif
#ifdef EH_RETURN_HANDLER_RTX
- if ((!HAVE_epilogue || ! epilogue_completed)
+ if ((!targetm.have_epilogue () || ! epilogue_completed)
&& crtl->calls_eh_return)
{
rtx tmp = EH_RETURN_HANDLER_RTX;
@@ -3801,16 +3742,15 @@ df_exit_block_uses_collect (struct df_collection_rec *collection_rec, bitmap exi
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[i], NULL,
EXIT_BLOCK_PTR_FOR_FN (cfun), NULL, DF_REF_REG_USE, 0);
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* It is deliberate that this is not put in the exit block uses but
I do not know why. */
- if (reload_completed
+ if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ && reload_completed
&& !bitmap_bit_p (exit_block_uses, ARG_POINTER_REGNUM)
&& bb_has_eh_pred (EXIT_BLOCK_PTR_FOR_FN (cfun))
&& fixed_regs[ARG_POINTER_REGNUM])
df_ref_record (DF_REF_ARTIFICIAL, collection_rec, regno_reg_rtx[ARG_POINTER_REGNUM], NULL,
EXIT_BLOCK_PTR_FOR_FN (cfun), NULL, DF_REF_REG_USE, 0);
-#endif
df_canonize_collection_rec (collection_rec);
}