mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
8bb025f55a
commit
23f39b3788
|
|
@ -1,3 +1,16 @@
|
||||||
|
2010-03-10 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
2010-03-10 Alexander Monakov <amonakov@ispras.ru>
|
2010-03-10 Alexander Monakov <amonakov@ispras.ru>
|
||||||
|
|
||||||
PR tree-optimization/43236
|
PR tree-optimization/43236
|
||||||
|
|
|
||||||
|
|
@ -8382,7 +8382,7 @@ ix86_get_drap_rtx (void)
|
||||||
unsigned int regno = find_drap_reg ();
|
unsigned int regno = find_drap_reg ();
|
||||||
rtx drap_vreg;
|
rtx drap_vreg;
|
||||||
rtx arg_ptr;
|
rtx arg_ptr;
|
||||||
rtx seq;
|
rtx seq, insn;
|
||||||
|
|
||||||
arg_ptr = gen_rtx_REG (Pmode, regno);
|
arg_ptr = gen_rtx_REG (Pmode, regno);
|
||||||
crtl->drap_reg = arg_ptr;
|
crtl->drap_reg = arg_ptr;
|
||||||
|
|
@ -8391,8 +8391,13 @@ ix86_get_drap_rtx (void)
|
||||||
drap_vreg = copy_to_reg (arg_ptr);
|
drap_vreg = copy_to_reg (arg_ptr);
|
||||||
seq = get_insns ();
|
seq = get_insns ();
|
||||||
end_sequence ();
|
end_sequence ();
|
||||||
|
|
||||||
emit_insn_before (seq, NEXT_INSN (entry_of_function ()));
|
insn = emit_insn_before (seq, NEXT_INSN (entry_of_function ()));
|
||||||
|
if (!optimize)
|
||||||
|
{
|
||||||
|
add_reg_note (insn, REG_CFA_SET_VDRAP, drap_vreg);
|
||||||
|
RTX_FRAME_RELATED_P (insn) = 1;
|
||||||
|
}
|
||||||
return drap_vreg;
|
return drap_vreg;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -2160,15 +2160,7 @@ dwarf2out_frame_debug_cfa_restore (rtx reg, const char *label)
|
||||||
&& cfa.indirect == 0
|
&& cfa.indirect == 0
|
||||||
&& cfa.reg != HARD_FRAME_POINTER_REGNUM
|
&& cfa.reg != HARD_FRAME_POINTER_REGNUM
|
||||||
effects: Use DW_CFA_def_cfa_expression to define cfa
|
effects: Use DW_CFA_def_cfa_expression to define cfa
|
||||||
cfa.reg == fde->drap_reg
|
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. */
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dwarf2out_frame_debug_expr (rtx expr, const char *label)
|
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 ();
|
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))
|
switch (GET_CODE (dest))
|
||||||
{
|
{
|
||||||
case REG:
|
case REG:
|
||||||
|
|
@ -2781,6 +2755,20 @@ dwarf2out_frame_debug (rtx insn, bool after_p)
|
||||||
handled_one = true;
|
handled_one = true;
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -12736,13 +12724,18 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
|
||||||
return new_loc_descr (DW_OP_fbreg, offset, 0);
|
return new_loc_descr (DW_OP_fbreg, offset, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fde
|
else if (!optimize
|
||||||
|
&& fde
|
||||||
&& fde->drap_reg != INVALID_REGNUM
|
&& fde->drap_reg != INVALID_REGNUM
|
||||||
&& (fde->drap_reg == REGNO (reg)
|
&& (fde->drap_reg == REGNO (reg)
|
||||||
|| fde->vdrap_reg == REGNO (reg)))
|
|| fde->vdrap_reg == REGNO (reg)))
|
||||||
{
|
{
|
||||||
/* Use cfa+offset to represent the location of arguments passed
|
/* 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);
|
return new_loc_descr (DW_OP_fbreg, offset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* Register note definitions.
|
/* Register note definitions.
|
||||||
Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GCC.
|
This file is part of GCC.
|
||||||
|
|
||||||
|
|
@ -153,6 +154,11 @@ REG_NOTE (CFA_REGISTER)
|
||||||
first pattern is the register to be restored. */
|
first pattern is the register to be restored. */
|
||||||
REG_NOTE (CFA_RESTORE)
|
REG_NOTE (CFA_RESTORE)
|
||||||
|
|
||||||
|
/* Attached to insn that is RTX_FRAME_RELATED_P, marks insn that sets
|
||||||
|
vDRAP from DRAP. If vDRAP is a register, vdrap_reg is initalized
|
||||||
|
to the argument, if it is a MEM, it is ignored. */
|
||||||
|
REG_NOTE (CFA_SET_VDRAP)
|
||||||
|
|
||||||
/* Indicates that REG holds the exception context for the function.
|
/* Indicates that REG holds the exception context for the function.
|
||||||
This context is shared by inline functions, so the code to acquire
|
This context is shared by inline functions, so the code to acquire
|
||||||
the real exception context is delayed until after inlining. */
|
the real exception context is delayed until after inlining. */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
|
2010-03-10 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR debug/36728
|
||||||
|
* gcc.dg/guality/pr36728-1.c: New test.
|
||||||
|
* gcc.dg/guality/pr36728-2.c: New test.
|
||||||
|
|
||||||
2010-03-10 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
|
2010-03-10 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
|
||||||
|
|
||||||
* gcc.dg/h8300-div-delay-slot.c: New test.
|
* gcc.dg/h8300-div-delay-slot.c: New test.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/* PR debug/36728 */
|
||||||
|
/* { dg-do run } */
|
||||||
|
/* { dg-options "-g" } */
|
||||||
|
|
||||||
|
int __attribute__((noinline))
|
||||||
|
foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
|
||||||
|
{
|
||||||
|
char *x = __builtin_alloca (arg7);
|
||||||
|
int __attribute__ ((aligned(32))) y;
|
||||||
|
|
||||||
|
y = 2;
|
||||||
|
asm volatile ("" : "=m" (y) : "m" (y));
|
||||||
|
x[0] = 25;
|
||||||
|
asm volatile ("" : "=m" (x[0]) : "m" (x[0]));
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { gdb-test 12 "arg1" "1" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg2" "2" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg3" "3" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg4" "4" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg5" "5" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg6" "6" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg7" "30" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "y" "2" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg1" "1" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg2" "2" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg3" "3" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg4" "4" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg5" "5" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg6" "6" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg7" "30" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "*x" "(char) 25" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "y" "2" } } */
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
int l = 0;
|
||||||
|
asm volatile ("" : "=r" (l) : "0" (l));
|
||||||
|
foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
/* PR debug/36728 */
|
||||||
|
/* { dg-do run } */
|
||||||
|
/* { dg-options "-g" } */
|
||||||
|
|
||||||
|
int __attribute__((noinline))
|
||||||
|
foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
|
||||||
|
{
|
||||||
|
char x[30];
|
||||||
|
int __attribute__ ((aligned(32))) y;
|
||||||
|
|
||||||
|
y = 2;
|
||||||
|
asm volatile ("" : "=m" (y) : "m" (y));
|
||||||
|
x[0] = 25;
|
||||||
|
asm volatile ("" : "=m" (x[0]) : "m" (x[0]));
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { gdb-test 12 "arg1" "1" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg2" "2" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg3" "3" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg4" "4" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg5" "5" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg6" "6" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "arg7" "30" } } */
|
||||||
|
/* { dg-final { gdb-test 12 "y" "2" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg1" "1" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg2" "2" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg3" "3" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg4" "4" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg5" "5" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg6" "6" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "arg7" "30" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "*x" "(char) 25" } } */
|
||||||
|
/* { dg-final { gdb-test 14 "y" "2" } } */
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
int l = 0;
|
||||||
|
asm volatile ("" : "=r" (l) : "0" (l));
|
||||||
|
foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue