aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-05-24 21:52:12 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-05-24 21:52:12 +0000
commit657730879110d20c9aa1de4f085a99e0ef6127de (patch)
tree767bba708d86dadbf1bca3d7fae97b4c60aa4a11
parentdd761d3aaf5724add090d6638191fa56f122782c (diff)
downloadgcc-657730879110d20c9aa1de4f085a99e0ef6127de.zip
gcc-657730879110d20c9aa1de4f085a99e0ef6127de.tar.gz
gcc-657730879110d20c9aa1de4f085a99e0ef6127de.tar.bz2
var-tracking.c (compute_cfa_pointer): Adjust head comment.
* var-tracking.c (compute_cfa_pointer): Adjust head comment. (vt_initialize): Set PROLOGUE_BB unconditionally. Add block comment about CFA_BASE_RTX machinery. Reset FP_CFA_OFFSET to -1 on all invalid paths. Call vt_init_cfa_base only if FP_CFA_OFFSET isn't equal to -1. From-SVN: r174146
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/var-tracking.c21
2 files changed, 25 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3e1b6e4..f98e134 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-05-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * var-tracking.c (compute_cfa_pointer): Adjust head comment.
+ (vt_initialize): Set PROLOGUE_BB unconditionally.
+ Add block comment about CFA_BASE_RTX machinery.
+ Reset FP_CFA_OFFSET to -1 on all invalid paths.
+ Call vt_init_cfa_base only if FP_CFA_OFFSET isn't equal to -1.
+
2011-05-24 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/48187
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 278f546..5e7c2fc 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -705,7 +705,8 @@ vt_stack_adjustments (void)
static rtx cfa_base_rtx;
static HOST_WIDE_INT cfa_base_offset;
-/* Compute a CFA-based value for the stack pointer. */
+/* Compute a CFA-based value for an ADJUSTMENT made to stack_pointer_rtx
+ or hard_frame_pointer_rtx. */
static inline rtx
compute_cfa_pointer (HOST_WIDE_INT adjustment)
@@ -8664,7 +8665,7 @@ vt_init_cfa_base (void)
static bool
vt_initialize (void)
{
- basic_block bb, prologue_bb = NULL;
+ basic_block bb, prologue_bb = single_succ (ENTRY_BLOCK_PTR);
HOST_WIDE_INT fp_cfa_offset = -1;
alloc_aux_for_blocks (sizeof (struct variable_tracking_info_def));
@@ -8722,6 +8723,16 @@ vt_initialize (void)
CLEAR_HARD_REG_SET (argument_reg_set);
+ /* In order to factor out the adjustments made to the stack pointer or to
+ the hard frame pointer and thus be able to use DW_OP_fbreg operations
+ instead of individual location lists, we're going to rewrite MEMs based
+ on them into MEMs based on the CFA by de-eliminating stack_pointer_rtx
+ or hard_frame_pointer_rtx to the virtual CFA pointer frame_pointer_rtx
+ resp. arg_pointer_rtx. We can do this either when there is no frame
+ pointer in the function and stack adjustments are consistent for all
+ basic blocks or when there is a frame pointer and no stack realignment.
+ But we first have to check that frame_pointer_rtx resp. arg_pointer_rtx
+ has been eliminated. */
if (!frame_pointer_needed)
{
rtx reg, elim;
@@ -8764,10 +8775,11 @@ vt_initialize (void)
}
if (elim != hard_frame_pointer_rtx)
fp_cfa_offset = -1;
- else
- prologue_bb = single_succ (ENTRY_BLOCK_PTR);
}
+ else
+ fp_cfa_offset = -1;
}
+
if (frame_pointer_needed)
{
rtx insn;
@@ -8868,6 +8880,7 @@ vt_initialize (void)
}
if (bb == prologue_bb
+ && fp_cfa_offset != -1
&& hard_frame_pointer_adjustment == -1
&& RTX_FRAME_RELATED_P (insn)
&& fp_setter (insn))