[gccsdk] [Bug 217] Stack Backtrace with certain programs built with gcc 4.6

bugzilla-daemon at riscos.info bugzilla-daemon at riscos.info
Sun Mar 4 05:39:55 PST 2012


--- Comment #7 from Lee <leenoar at sky.com> 2012-03-04 05:39:54 PST ---
I'm afraid the v5 thing may be a red herring. V5 is never saved because it is
declared as a call used register due to its use as a scratch register in the
Procedure Linkage Table entries. If you look at the assembler output, you'll
see that GCC saves v5 to the stack before a function call and reloads it after
(assuming its value needs to be kept) - it knows that a call through the PLT
will corrupt it. __rt_stkovf_split_{small/big} are also called via the PLT, but
because we insert them into the instruction stream directly, GCC isn't aware of
the v5 problem. To get around this, I added an extra constraint to tell GCC
that a stack extension will clobber v5 so that it knows not to expect v5 to be
preserved across the stack extension calls.

It's not uncommon for v5 to be used as a scratch register without being saved,
in much the same way as a1-a4 are.

Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the gcc mailing list