浏览代码

Merged revisions 10710,10712 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r10710 | florian | 2008-04-19 11:23:45 +0200 (Sa, 19 Apr 2008) | 2 lines

* first try to fix #10863 (don't do SSL in case left is already handled in an assignment node)
........
r10712 | florian | 2008-04-19 13:38:54 +0200 (Sa, 19 Apr 2008) | 2 lines

* cleaned up overleft of 10710
........

git-svn-id: branches/fixes_2_2@10713 -

florian 17 年之前
父节点
当前提交
35f7ba89f7
共有 3 个文件被更改,包括 22 次插入5 次删除
  1. 9 2
      compiler/ncgld.pas
  2. 3 2
      compiler/ncgutil.pas
  3. 10 1
      compiler/pass_2.pas

+ 9 - 2
compiler/ncgld.pas

@@ -369,8 +369,8 @@ implementation
          href : treference;
          releaseright : boolean;
          len : aint;
-         r:Tregister;
-
+         r : tregister;
+         oldflowcontrol : tflowcontrol;
       begin
         location_reset(location,LOC_VOID,OS_NO);
 
@@ -436,9 +436,16 @@ implementation
            if codegenerror then
              exit;
 
+           { tell the SSA/SSL code that the left side was handled first so
+             ni SSL is done
+           }
+           oldflowcontrol:=flowcontrol;
+           include(flowcontrol,fc_lefthandled);
+
            { left can't be never a 64 bit LOC_REGISTER, so the 3. arg }
            { can be false                                             }
            secondpass(right);
+           flowcontrol:=oldflowcontrol;
            { increment source reference counter, this is
              useless for string constants}
            if (right.resultdef.needs_inittable) and

+ 3 - 2
compiler/ncgutil.pas

@@ -2016,7 +2016,7 @@ implementation
         if (current_module.islibrary) then
           if (current_procinfo.procdef.proctypeoption = potype_proginit) then
             exportlib.setinitname(list,current_procinfo.procdef.mangledname);
-        
+
         if (current_procinfo.procdef.proctypeoption=potype_proginit) then
           begin
            if (target_info.system in (systems_darwin+[system_powerpc_macos])) and
@@ -2523,7 +2523,7 @@ implementation
         rr: treplaceregrec;
       begin
         if not (n.location.loc in [LOC_CREGISTER,LOC_CFPUREGISTER,LOC_CMMXREGISTER,LOC_CMMREGISTER]) or
-           ([fc_inflowcontrol,fc_gotolabel] * flowcontrol <> []) then
+          ([fc_inflowcontrol,fc_gotolabel,fc_lefthandled] * flowcontrol <> []) then
           exit;
         rr.old := n.location.register;
         rr.ressym := nil;
@@ -2785,3 +2785,4 @@ implementation
 
 end.
 
+

+ 10 - 1
compiler/pass_2.pas

@@ -29,7 +29,16 @@ uses
    node;
 
     type
-       tenumflowcontrol = (fc_exit,fc_break,fc_continue,fc_inflowcontrol,fc_gotolabel);
+       tenumflowcontrol = (
+         fc_exit,
+         fc_break,
+         fc_continue,
+         fc_inflowcontrol,
+         fc_gotolabel,
+         { the left side of an expression is already handled, so we are
+           not allowed to do ssl }
+         fc_lefthandled);
+
        tflowcontrol = set of tenumflowcontrol;
 
     var