> > This example shows local in %eax, which is a caller-save (i.e.,
> > scratch) register. GCC is right to show that the value is unknown upon
> > return from the call, because set() can clobber that register.
>
> Sorry, typo -- %eax is a *callee-save* register.

Argh! No, I was right the first time. %eax is a caller-save (scratch) register.

Here was the typo:

> Try changing your code so that you use the value of local after the
> call to set() -- say, make it "local += 123" -- and see the
> difference. My copy of GCC moves local to %ebx, which is a caller-save
> register, and the location list shows it live in that register all the
> way through the call and return.

%ebx is a *callee-save* (preserved) register.

I always have to think twice and I still get callee-save and
caller-save backwards! That's why I prefer the terms "scratch" and
"preserved".

Sorry for the confusion. David correctly said it was a caller-save
register in his original mail, and if I hadn't thought "callee-save"
instead, I'd have been able to answer his question straight away.

-cary
_______________________________________________
Dwarf-Discuss mailing list
Dwarf-Discuss@lists.dwarfstd.org
http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org

Reply via email to