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: [RFA] dwarf2out.c: Don't emit DW_OP_regx for register -1


On Mar 6,  4:47pm, Jason Merrill wrote:

> This situation sounds like something's broken in the compiler; surely
> DBX_REGISTER_NUMBER should say something about all hard regs.

I agree that this would be desirable.

> Or is the problem that we're seeing a pseudo-reg in the DECL_RTL of a
> variable that's been optimized away?  That sounds vaguely familiar, and
> providing no location info seems appropriate for that situation.

No, it's a hard reg. In the case that I was looking at, I believe it
was LO_REG (on mips).  This is the low order result from a multiplication
operation.  Special instructions are needed to access the "lo" and "hi"
registers.

The other odd thing about the case that I was looking at was that the
variable assigned to "lo" was accessed once, but never initialized.

Anyway... on mips, DBX_REGISTER_NUMBER is defined as:

  #define DBX_REGISTER_NUMBER(REGNO) mips_dbx_regno[ (REGNO) ]

where mips_dbx_regno[] is initialized as follows:

  /* Set up array to map GCC register number to debug register number.
     Ignore the special purpose register numbers.  */

  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
    mips_dbx_regno[i] = -1;

  start = GP_DBX_FIRST - GP_REG_FIRST;
  for (i = GP_REG_FIRST; i <= GP_REG_LAST; i++)
    mips_dbx_regno[i] = i + start;

  start = FP_DBX_FIRST - FP_REG_FIRST;
  for (i = FP_REG_FIRST; i <= FP_REG_LAST; i++)
    mips_dbx_regno[i] = i + start;

So, according to the comment, the hi and lo registers are unmapped on
purpose.  (I don't know why though.)

Kevin


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