Lines 3704-3709
expand_debug_source_expr (tree exp)
Link Here
|
3704 |
return op0; |
3704 |
return op0; |
3705 |
} |
3705 |
} |
3706 |
|
3706 |
|
|
|
3707 |
/* Ensure INSN_VAR_LOCATION_LOC (insn) doesn't have unbound complexity. |
3708 |
Allow 4 levels of rtl nesting for most rtl codes, and if we see anything |
3709 |
deeper than that, create DEBUG_EXPRs and emit DEBUG_INSNs before INSN. */ |
3710 |
|
3711 |
static void |
3712 |
avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth) |
3713 |
{ |
3714 |
rtx exp = *exp_p; |
3715 |
if (exp == NULL_RTX) |
3716 |
return; |
3717 |
if ((OBJECT_P (exp) && !MEM_P (exp)) || GET_CODE (exp) == CLOBBER) |
3718 |
return; |
3719 |
|
3720 |
if (depth == 4) |
3721 |
{ |
3722 |
/* Create DEBUG_EXPR (and DEBUG_EXPR_DECL). */ |
3723 |
rtx dval = make_debug_expr_from_rtl (exp); |
3724 |
|
3725 |
/* Emit a debug bind insn before INSN. */ |
3726 |
rtx bind = gen_rtx_VAR_LOCATION (GET_MODE (exp), |
3727 |
DEBUG_EXPR_TREE_DECL (dval), exp, |
3728 |
VAR_INIT_STATUS_INITIALIZED); |
3729 |
|
3730 |
emit_debug_insn_before (bind, insn); |
3731 |
*exp_p = dval; |
3732 |
return; |
3733 |
} |
3734 |
|
3735 |
const char *format_ptr = GET_RTX_FORMAT (GET_CODE (exp)); |
3736 |
int i, j; |
3737 |
for (i = 0; i < GET_RTX_LENGTH (GET_CODE (exp)); i++) |
3738 |
switch (*format_ptr++) |
3739 |
{ |
3740 |
case 'e': |
3741 |
avoid_complex_debug_insns (insn, &XEXP (exp, i), depth + 1); |
3742 |
break; |
3743 |
|
3744 |
case 'E': |
3745 |
case 'V': |
3746 |
for (j = 0; j < XVECLEN (exp, i); j++) |
3747 |
avoid_complex_debug_insns (insn, &XVECEXP (exp, i, j), depth + 1); |
3748 |
break; |
3749 |
|
3750 |
default: |
3751 |
break; |
3752 |
} |
3753 |
} |
3754 |
|
3707 |
/* Expand the _LOCs in debug insns. We run this after expanding all |
3755 |
/* Expand the _LOCs in debug insns. We run this after expanding all |
3708 |
regular insns, so that any variables referenced in the function |
3756 |
regular insns, so that any variables referenced in the function |
3709 |
will have their DECL_RTLs set. */ |
3757 |
will have their DECL_RTLs set. */ |
Lines 3724-3730
expand_debug_locations (void)
Link Here
|
3724 |
if (DEBUG_INSN_P (insn)) |
3772 |
if (DEBUG_INSN_P (insn)) |
3725 |
{ |
3773 |
{ |
3726 |
tree value = (tree)INSN_VAR_LOCATION_LOC (insn); |
3774 |
tree value = (tree)INSN_VAR_LOCATION_LOC (insn); |
3727 |
rtx val; |
3775 |
rtx val, prev_insn, insn2; |
3728 |
enum machine_mode mode; |
3776 |
enum machine_mode mode; |
3729 |
|
3777 |
|
3730 |
if (value == NULL_TREE) |
3778 |
if (value == NULL_TREE) |
Lines 3753-3758
expand_debug_locations (void)
Link Here
|
3753 |
} |
3801 |
} |
3754 |
|
3802 |
|
3755 |
INSN_VAR_LOCATION_LOC (insn) = val; |
3803 |
INSN_VAR_LOCATION_LOC (insn) = val; |
|
|
3804 |
prev_insn = PREV_INSN (insn); |
3805 |
for (insn2 = insn; insn2 != prev_insn; insn2 = PREV_INSN (insn2)) |
3806 |
avoid_complex_debug_insns (insn2, &INSN_VAR_LOCATION_LOC (insn2), 0); |
3756 |
} |
3807 |
} |
3757 |
|
3808 |
|
3758 |
flag_strict_aliasing = save_strict_alias; |
3809 |
flag_strict_aliasing = save_strict_alias; |