[patch] Fix gcc.c-torture/execute/20000706-3.c for the v850
Catherine Moore
clm@redhat.com
Fri May 3 11:57:00 GMT 2002
The execution of gcc.c-torture/execute/20000706-3.c never
completed because the generated code was overwriting the
return address on the stack. This patch fixes that problem
by correcting the calculation of the register save area
size.
Catherine
* config/v850/v850.c (compute_register_save_size): Make sure
to count all of the registers that will be saved.
Index: v850.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/v850/v850.c,v
retrieving revision 1.54
diff -p -r1.54 v850.c
*** v850.c 22 Mar 2002 19:29:21 -0000 1.54
--- v850.c 3 May 2002 18:14:38 -0000
*************** compute_register_save_size (p_reg_saved)
*** 1442,1455 ****
need to cover the possibility that such a helper function will
be used, despite the fact that there might be gaps in the list of
registers that need to be saved. To detect this we note that the
! helper functions always push at least register r29 if the link
! register is not used, and at least registers r27 - r31 if the
! link register is used (and provided that the function is not an
! interrupt handler). */
if (TARGET_PROLOG_FUNCTION
! && (i == 2 || i >= 20)
! && regs_ever_live[LINK_POINTER_REGNUM] ? (i < 28) : (i < 30))
{
if (i == 2)
{
--- 1442,1452 ----
need to cover the possibility that such a helper function will
be used, despite the fact that there might be gaps in the list of
registers that need to be saved. To detect this we note that the
! helper functions always push at least register r29 (provided
! that the function is not an interrupt handler). */
if (TARGET_PROLOG_FUNCTION
! && (i == 2 || i >= 20 && (i < 30)))
{
if (i == 2)
{
More information about the Gcc-patches
mailing list