This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -m32 -g -O0 debug info (PR debug/48466)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>, Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, hjl dot tools at gmail dot com
- Date: Wed, 6 Apr 2011 01:07:38 +0200
- Subject: Re: [PATCH] Fix -m32 -g -O0 debug info (PR debug/48466)
- References: <20110405224311.GF17079@tyan-ft48-01.lab.bos.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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