This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: PING: [RFA/i386] 2 more patterns in i386_analyze_stack_align


Hi Mark,

A followup on a recent discussion:

> Hmm, you're missing the %ebx case here.  Now on ELF systems, you'll
> probably never see it since %ebx is used for GOT access, but on other
> object formats I don't think there is any reason why GCC wouldn't
> choose to use %ebx as well.

I consulted with Olivier Hainque and here is what I learnt:

  . The current FSF GCC only uses %ecx, and punts on any realignment
    request for a function which needs ecx for other purposes, like
    neted functions with a static chain.

  . We have a local enhancement that takes advantage of the fact
    that when ecx is not available, edx and then eax are used.

    I wasn't aware of the fact that this change was local when
    I submitted my patch.  I don't know yet why this change was
    not contributed, probably lack of time. Hopefully it will be
    included soon.

  . In terms of what registers can be ued in the realignment sequence,
    Olivier said:

      The "available" registers are the ABI caller-saved registers "dead"
      on both entry and exit of the function, that is, not used for arg
      passing, static chain or value returning.

  . The current implementation is SVR4 ABI oriented AFAICT, and ebx is
    not a possible candidate because it is callee-saved. We're not sure
    about the status of non-elf targets.

As a result, I think it's 50/50 in terms of adding the %ebx sequence.
I would recommend adding it anyway, with a small comment, just to be
on the safe side. I don't think we can break anything in the debugger
with such a change, and yet nothing worse than a broken callstack
when you're trying to track a bug down.

Let me know what you think.

-- 
Joel


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