aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-01-17 17:21:49 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-01-17 17:21:49 +0100
commitee3d2ecdc509868214e682f4192cf7047d57a78d (patch)
tree063806ffabfecffdb1aa308a9a26013274f0668b /gcc/function.c
parent3b4f05ec1ee0a91c937f9c90df8addf6aec7ad5f (diff)
downloadgcc-ee3d2ecdc509868214e682f4192cf7047d57a78d.zip
gcc-ee3d2ecdc509868214e682f4192cf7047d57a78d.tar.gz
gcc-ee3d2ecdc509868214e682f4192cf7047d57a78d.tar.bz2
re PR target/51872 (Shrink-wrapping with -mminimal-toc causes bootstrap failure)
PR bootstrap/51872 * hard-reg-set.h (struct hard_reg_set_container): New type. * target.h (struct hard_reg_set_container): Forward declare. * target.def (set_up_by_prologue): New target hook. * doc/tm.texi.in (TARGET_SET_UP_BY_PROLOGUE): Document it. * doc/tm.texi: Regenerated. * function.c (thread_prologue_and_epilogue_insns): Change set_up_by_prologue HARD_REG_SET into struct hard_reg_set_container. Call targetm.set_up_by_prologue on it. * config/rs6000/rs6000.c (rs6000_set_up_by_prologue): New function. (TARGET_SET_UP_BY_PROLOGUE): Redefine to it. From-SVN: r183254
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/function.c b/gcc/function.c
index cd82da4..fcb79f5 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1,7 +1,7 @@
/* Expands front end tree to back end RTL for GCC.
Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011 Free Software Foundation, Inc.
+ 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -5899,7 +5899,7 @@ thread_prologue_and_epilogue_insns (void)
&& nonempty_prologue && !crtl->calls_eh_return)
{
HARD_REG_SET prologue_clobbered, prologue_used, live_on_edge;
- HARD_REG_SET set_up_by_prologue;
+ struct hard_reg_set_container set_up_by_prologue;
rtx p_insn;
VEC(basic_block, heap) *vec;
basic_block bb;
@@ -5939,18 +5939,22 @@ thread_prologue_and_epilogue_insns (void)
vec = VEC_alloc (basic_block, heap, n_basic_blocks);
- CLEAR_HARD_REG_SET (set_up_by_prologue);
- add_to_hard_reg_set (&set_up_by_prologue, Pmode, STACK_POINTER_REGNUM);
- add_to_hard_reg_set (&set_up_by_prologue, Pmode, ARG_POINTER_REGNUM);
+ CLEAR_HARD_REG_SET (set_up_by_prologue.set);
+ add_to_hard_reg_set (&set_up_by_prologue.set, Pmode,
+ STACK_POINTER_REGNUM);
+ add_to_hard_reg_set (&set_up_by_prologue.set, Pmode, ARG_POINTER_REGNUM);
if (frame_pointer_needed)
- add_to_hard_reg_set (&set_up_by_prologue, Pmode,
+ add_to_hard_reg_set (&set_up_by_prologue.set, Pmode,
HARD_FRAME_POINTER_REGNUM);
if (pic_offset_table_rtx)
- add_to_hard_reg_set (&set_up_by_prologue, Pmode,
+ add_to_hard_reg_set (&set_up_by_prologue.set, Pmode,
PIC_OFFSET_TABLE_REGNUM);
if (stack_realign_drap && crtl->drap_reg)
- add_to_hard_reg_set (&set_up_by_prologue, GET_MODE (crtl->drap_reg),
+ add_to_hard_reg_set (&set_up_by_prologue.set,
+ GET_MODE (crtl->drap_reg),
REGNO (crtl->drap_reg));
+ if (targetm.set_up_by_prologue)
+ targetm.set_up_by_prologue (&set_up_by_prologue);
/* We don't use a different max size depending on
optimize_bb_for_speed_p because increasing shrink-wrapping
@@ -5968,7 +5972,7 @@ thread_prologue_and_epilogue_insns (void)
if (NONDEBUG_INSN_P (insn))
{
if (requires_stack_frame_p (insn, prologue_used,
- set_up_by_prologue))
+ set_up_by_prologue.set))
{
if (bb == entry_edge->dest)
goto fail_shrinkwrap;