diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7310f3d383..3823eb634ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2008-07-31 H.J. Lu + + PR debug/36977 + * cfgexpand.c (expand_stack_alignment): Set stack_realign_tried. + + * dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried + for stack alignment. + + * function.h (rtl_data): Add stack_realign_tried. Update + comments. + 2008-07-31 Kaz Kojima * config/sh/sh.c (sh_canonical_va_list_type): Remove. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 623ad85afb4..c9faa49d4ab 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -2217,6 +2217,7 @@ expand_stack_alignment (void) crtl->stack_realign_needed = INCOMING_STACK_BOUNDARY < crtl->stack_alignment_estimated; + crtl->stack_realign_tried = crtl->stack_realign_needed; crtl->stack_realign_processed = true; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 1219892f200..7e29d2af746 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9453,8 +9453,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset, pointer + offset to access stack variables. If stack is aligned without drap, use stack pointer + offset to access stack variables. */ - if (fde - && fde->stack_realign + if (crtl->stack_realign_tried && cfa.reg == HARD_FRAME_POINTER_REGNUM && reg == frame_pointer_rtx) { diff --git a/gcc/function.h b/gcc/function.h index ebba29f3862..1153fb0b4c4 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -417,20 +417,25 @@ struct rtl_data GTY(()) /* When set, expand should optimize for speed. */ bool maybe_hot_insn_p; - /* Nonzero if function stack realignment is needed. This flag may be - set twice: before and after reload. It is set before reload wrt - stack alignment estimation before reload. It will be changed after - reload if by then criteria of stack realignment is different. + /* Nonzero if function stack realignment is needed. This flag may be + set twice: before and after reload. It is set before reload wrt + stack alignment estimation before reload. It will be changed after + reload if by then criteria of stack realignment is different. The value set after reload is the accurate one and is finalized. */ bool stack_realign_needed; + /* Nonzero if function stack realignment is tried. This flag is set + only once before reload. It affects register elimination. This + is used to generate DWARF debug info for stack variables. */ + bool stack_realign_tried; + /* Nonzero if function being compiled needs dynamic realigned argument pointer (drap) if stack needs realigning. */ bool need_drap; /* Nonzero if function stack realignment estimation is done, namely - stack_realign_needed flag has been set before reload wrt - estimated stack alignment info. */ + stack_realign_needed flag has been set before reload wrt estimated + stack alignment info. */ bool stack_realign_processed; /* Nonzero if function stack realignment has been finalized, namely