X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fvar-tracking.c;h=c980da6d05a952592e5e68c55928ea32e121265e;hb=36083c0377f294eaaa0809a77b2d967b6efd34e8;hp=261d47a7cffbd7003e1a3d2deb0dae233e902d2f;hpb=910193a57fac011e0a432ead13c2e5f36583ed13;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 261d47a7cff..c980da6d05a 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -1573,9 +1573,12 @@ static inline tree var_debug_decl (tree decl) { if (decl && DECL_P (decl) - && DECL_DEBUG_EXPR_IS_FROM (decl) && DECL_DEBUG_EXPR (decl) - && DECL_P (DECL_DEBUG_EXPR (decl))) - decl = DECL_DEBUG_EXPR (decl); + && DECL_DEBUG_EXPR_IS_FROM (decl)) + { + tree debugdecl = DECL_DEBUG_EXPR (decl); + if (debugdecl && DECL_P (debugdecl)) + decl = debugdecl; + } return decl; } @@ -4497,13 +4500,32 @@ track_expr_p (tree expr, bool need_rtl) don't need to track this expression if the ultimate declaration is ignored. */ realdecl = expr; - if (DECL_DEBUG_EXPR_IS_FROM (realdecl) && DECL_DEBUG_EXPR (realdecl)) + if (DECL_DEBUG_EXPR_IS_FROM (realdecl)) { realdecl = DECL_DEBUG_EXPR (realdecl); - /* ??? We don't yet know how to emit DW_OP_piece for variable - that has been SRA'ed. */ - if (!DECL_P (realdecl)) - return 0; + if (realdecl == NULL_TREE) + realdecl = expr; + else if (!DECL_P (realdecl)) + { + if (handled_component_p (realdecl)) + { + HOST_WIDE_INT bitsize, bitpos, maxsize; + tree innerdecl + = get_ref_base_and_extent (realdecl, &bitpos, &bitsize, + &maxsize); + if (!DECL_P (innerdecl) + || DECL_IGNORED_P (innerdecl) + || TREE_STATIC (innerdecl) + || bitsize <= 0 + || bitpos + bitsize > 256 + || bitsize != maxsize) + return 0; + else + realdecl = expr; + } + else + return 0; + } } /* Do not track EXPR if REALDECL it should be ignored for debugging @@ -8101,10 +8123,10 @@ vt_init_cfa_base (void) if (!MAY_HAVE_DEBUG_INSNS) return; - val = cselib_lookup (cfa_base_rtx, GET_MODE (cfa_base_rtx), 1); + val = cselib_lookup_from_insn (cfa_base_rtx, GET_MODE (cfa_base_rtx), 1, + get_insns ()); preserve_value (val); cselib_preserve_cfa_base_value (val); - val->locs->setting_insn = get_insns (); var_reg_decl_set (&VTI (ENTRY_BLOCK_PTR)->out, cfa_base_rtx, VAR_INIT_STATUS_INITIALIZED, dv_from_value (val->val_rtx), 0, NULL_RTX, INSERT);