[PATCH] Don't mark set of vDRAP from DRAP as frame related (PR debug/43290)
Jakub Jelinek
jakub@redhat.com
Sun Mar 14 20:40:00 GMT 2010
On Wed, Mar 10, 2010 at 08:10:10AM -0800, Richard Henderson wrote:
> On 03/10/2010 03:03 AM, Jakub Jelinek wrote:
> > 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.
>
> Ok. Thanks for the test cases.
Oops, another follow-up. Apparently (seen on a bunch of libgomp.c++
testcase in 4.4-RH backport of the patch, but the trunk has the same issue
latent) even when expand_stack_alignment thinks stack realignment might
be needed and thus does crtl->args.internal_arg_pointer = drap_rtx;
(and the computation of drap_rtx created vDRAP = DRAP insn with
REG_CFA_SET_VDRAP note), if reload didn't actually reload anything which
needs the larger alignment to the stack, ix86_expand_prologue
and ix86_finalize_stack_realign_flags in it might decide not to realign
the stack in the end. Thus fde->drap_rtx is NULL and the REG_CFA_SET_VDRAP
handling code ICEs. Apparently we want to set vdrap_reg even in that case
and replace it in based_loc_descr though, as crtl->args.internal_arg_pointer
is still that vDRAP register and thus is used as base of DECL_RTL of
parameters.
Ok for trunk?
2010-03-14 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (dwarf2out_frame_debug): Don't assert drap_reg
has been set.
(based_loc_descr): Use DW_OP_fbreg for vdrap_reg even when
drap_reg has not been set.
--- gcc/dwarf2out.c.jj 2010-03-12 14:05:32.000000000 +0100
+++ gcc/dwarf2out.c 2010-03-14 21:24:23.000000000 +0100
@@ -2760,11 +2760,12 @@ dwarf2out_frame_debug (rtx insn, bool af
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);
+ if (fde)
+ {
+ gcc_assert (fde->vdrap_reg == INVALID_REGNUM);
+ if (REG_P (n))
+ fde->vdrap_reg = REGNO (n);
+ }
}
handled_one = true;
break;
@@ -12726,7 +12727,6 @@ based_loc_descr (rtx reg, HOST_WIDE_INT
}
else if (!optimize
&& fde
- && fde->drap_reg != INVALID_REGNUM
&& (fde->drap_reg == REGNO (reg)
|| fde->vdrap_reg == REGNO (reg)))
{
Jakub
More information about the Gcc-patches
mailing list