This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix -m32 -g -O0 debug info (PR debug/48466)


On Wed, Apr 06, 2011 at 12:43:11AM +0200, Jakub Jelinek wrote:
> On the pr48466.c testcase below on i?86 -m32 -g -O0 we generate wrong debug
> info for some of the variables in main.  This was caused by PR36977 fix,
> crtl->stack_realign_tried is true, but fde->drap_reg is INVALID_REGNUM,
> but frame_pointer_rtx is being eliminated to hard_frame_pointer_regnum
> rather than stack_pointer_regnum.  Fixed by using hfp instead of sp
> in that case, the patch is also adding a testcase from PR36977 to make sure
> it doesn't regress.

FYI, the difference in between pr36977.c and pr48466.c is that in the
latter emit_call_1 to foo (which returns a struct) sets crtl->need_drap, and
while we don't create any stack realignment in the end because it wasn't
needed, it affected register elimination:
      ep->can_eliminate = ep->can_eliminate_previous
        = (targetm.can_eliminate (ep->from, ep->to)
           && ! (ep->to == STACK_POINTER_REGNUM
                 && frame_pointer_needed
                 && (! SUPPORTS_STACK_ALIGNMENT
                     || ! stack_realign_fp)));


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]