* fixed crashes when combining -Cg with -g or -pg due to a missing

restore of lr in leaf procedures in that case (Darwin-only)

git-svn-id: trunk@8675 -
This commit is contained in:
Jonas Maebe 2007-09-28 23:27:16 +00:00
parent 993ec01a76
commit b9752680a5

View File

@ -183,7 +183,11 @@ unit cgppc;
a_label(list,current_procinfo.CurrGOTLabel);
a_reg_alloc(list,current_procinfo.got);
list.concat(taicpu.op_reg_reg(A_MFSPR,current_procinfo.got,NR_LR));
if not savedlr then
if not savedlr or
{ in the following case lr is saved, but not restored }
{ (happens e.g. when generating debug info for leaf }
{ procedures) }
not(pi_do_call in current_procinfo.flags) then
list.concat(taicpu.op_reg_reg(A_MTSPR,NR_LR,NR_R0));
end;
end;