瀏覽代碼

* 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 -

Jonas Maebe 18 年之前
父節點
當前提交
b9752680a5
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      compiler/ppcgen/cgppc.pas

+ 5 - 1
compiler/ppcgen/cgppc.pas

@@ -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;