This is the mail archive of the 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: hard_regno_nregs == 0 ?

On Thu, 2008-01-10 at 19:16 -0500, DJ Delorie wrote:
> IIRC, the bug happened building either libgcc or newlib.  If you want
> to revert my latest patch in a local source tree and just try a build,
> it's likely to show you an example ;-)

It was unwind-dw2.c in the m32cm libgcc multilib.

The problem lies with the var-tracking pass.  It sees a QImode variable
being held in an HImode hard-reg, and decides to track only the low
QImode part.  This happens in track_loc_p, when it decides to use
DECL_MODE instead of the hard reg mode.  We then have to create RTL to
represent the part that we are tracking, which means we have to create
an invalid QImode lowpart of a hard reg that can't hold QImode values.
Since we will only use this for emitting debug info this seems perfectly
harmless.  Unfortunately, this does mean that HARD_REGNO_NREGS must work
correctly for invalid register modes.  We need that info in order to
construct the lowpart/subreg.  Nowhere does var-tracking check to see if
it is creating a valid register references, nor do I think this is

Hence, I now believe that your suggested doc change is correct, and is
OK to check in to mainline.
Jim Wilson, GNU Tools Support,

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