This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in Dwarf2 .debug_frame section [RE: Gcc 3.0 and ARM Stack fram e]
- To: Fabrice Gautier <Fabrice_Gautier at sdesigns dot com>
- Subject: Re: Bug in Dwarf2 .debug_frame section [RE: Gcc 3.0 and ARM Stack fram e]
- From: Richard Henderson <rth at redhat dot com>
- Date: Fri, 28 Sep 2001 00:17:40 -0700
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- References: <B1F6452C89AFD411AE0800A0CC734C230150E7@EMAIL1>
On Thu, Sep 27, 2001 at 08:24:53PM -0700, Fabrice Gautier wrote:
> > This isn't possible in general, since without the offset from the
> > register to the CFA, offsets elsewhere would not be representable
> > with unsigned scaled quantities.
>
> I'm not sure I understand your point. My idea is that when you have
> CFA = R11 + 4
> R0 = [CFA - 8]
>
> you code instead CFA = R11 and R0 = [CFA - 4]
If the CFA is in the middle of the stack frame, then it stands to reason
that there must be data at both positive and negative offsets from the
CFA. If it were otherwise that would imply you're allocating unused stack
space, and that would be silly.
But we have an unsigned offset, scaled by a signed constant, so that means
we can represent only positive offsets or only negative offsets from the
CFA. Which means that there must be some data that is not addressable.
Also, how do you represent the CFA in the few instructions before R11 is
set up? The canonical frame address is called "canonical" because it
never changes. Your initial CFA would have to be, e.g., SP-4, but note
that -4 is not representable by DW_CFA_def_cfa or DW_CFA_def_cfa_offset.
Dwarf 2.1 added DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf, which do
take signed offsets, but that's not going to help you with AXD, I'm sure.
So you'll wind up with a CFA that isn't actually canonical, which is
bound to cause you other problems.
r~