diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-03-10 19:17:10 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-03-10 19:17:10 +0100 |
commit | 23f39b378852d679e5d24bbc204ec4ca8fefbd8c (patch) | |
tree | dacbe9fcddf5ad20226ea333141629bbab53dd47 /gcc/dwarf2out.c | |
parent | 8bb025f55a97aec05b9aaff2147b2df6009e90ad (diff) | |
download | gcc-23f39b378852d679e5d24bbc204ec4ca8fefbd8c.zip gcc-23f39b378852d679e5d24bbc204ec4ca8fefbd8c.tar.gz gcc-23f39b378852d679e5d24bbc204ec4ca8fefbd8c.tar.bz2 |
re PR debug/43290 (ICE in dwarf2out_frame_debug_expr)
PR debug/43290
* reg-notes.def (REG_CFA_SET_VDRAP): New note.
* dwarf2out.c (dwarf2out_frame_debug_expr): Remove rule 20 - setting
of fde->vdrap_reg.
(dwarf2out_frame_debug): Handle REG_CFA_SET_VDRAP note.
(based_loc_descr): Only express drap or vdrap regno based expressions
using DW_OP_fbreg when not optimizing.
* config/i386/i386.c (ix86_get_drap_rtx): When not optimizing,
make the vDRAP = DRAP assignment RTX_FRAME_RELATED_P and add
REG_CFA_SET_VDRAP note.
PR debug/36728
* gcc.dg/guality/pr36728-1.c: New test.
* gcc.dg/guality/pr36728-2.c: New test.
From-SVN: r157363
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5aa9df4..4601444 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2160,15 +2160,7 @@ dwarf2out_frame_debug_cfa_restore (rtx reg, const char *label) && cfa.indirect == 0 && cfa.reg != HARD_FRAME_POINTER_REGNUM effects: Use DW_CFA_def_cfa_expression to define cfa - cfa.reg == fde->drap_reg - - Rule 20: - (set reg fde->drap_reg) - constraints: fde->vdrap_reg == INVALID_REGNUM - effects: fde->vdrap_reg = reg. - (set mem fde->drap_reg) - constraints: fde->drap_reg_saved == 1 - effects: none. */ + cfa.reg == fde->drap_reg */ static void dwarf2out_frame_debug_expr (rtx expr, const char *label) @@ -2239,24 +2231,6 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label) fde = current_fde (); - if (REG_P (src) - && fde - && fde->drap_reg == REGNO (src) - && (fde->drap_reg_saved - || REG_P (dest))) - { - /* Rule 20 */ - /* If we are saving dynamic realign argument pointer to a - register, the destination is virtual dynamic realign - argument pointer. It may be used to access argument. */ - if (REG_P (dest)) - { - gcc_assert (fde->vdrap_reg == INVALID_REGNUM); - fde->vdrap_reg = REGNO (dest); - } - return; - } - switch (GET_CODE (dest)) { case REG: @@ -2781,6 +2755,20 @@ dwarf2out_frame_debug (rtx insn, bool after_p) handled_one = true; break; + case REG_CFA_SET_VDRAP: + n = XEXP (note, 0); + if (REG_P (n)) + { + dw_fde_ref fde = current_fde (); + gcc_assert (fde + && fde->drap_reg != INVALID_REGNUM + && fde->vdrap_reg == INVALID_REGNUM); + if (REG_P (n)) + fde->vdrap_reg = REGNO (n); + } + handled_one = true; + break; + default: break; } @@ -12736,13 +12724,18 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset, return new_loc_descr (DW_OP_fbreg, offset, 0); } } - else if (fde + else if (!optimize + && fde && fde->drap_reg != INVALID_REGNUM && (fde->drap_reg == REGNO (reg) || fde->vdrap_reg == REGNO (reg))) { /* Use cfa+offset to represent the location of arguments passed - on stack when drap is used to align stack. */ + on the stack when drap is used to align stack. + Only do this when not optimizing, for optimized code var-tracking + is supposed to track where the arguments live and the register + used as vdrap or drap in some spot might be used for something + else in other part of the routine. */ return new_loc_descr (DW_OP_fbreg, offset, 0); } |