Browse Source

* Inc/Dec nodes converted to Add/Sub now remove
the "nf_modify" flag from the destination so
constant propagation works more efficiently.

J. Gareth "Curious Kit" Moreton 1 year ago
parent
commit
e60a7d01a4
1 changed files with 3 additions and 1 deletions
  1. 3 1
      compiler/ninl.pas

+ 3 - 1
compiler/ninl.pas

@@ -4947,6 +4947,8 @@ implementation
            end;
            end;
 
 
          resultnode := hp.getcopy;
          resultnode := hp.getcopy;
+         { Remove "modify" flag from what will be an assignment destination }
+         Exclude(resultnode.flags, nf_modify);
 
 
          { avoid type errors from the addn/subn }
          { avoid type errors from the addn/subn }
          if not is_integer(resultnode.resultdef) then
          if not is_integer(resultnode.resultdef) then
@@ -4955,7 +4957,7 @@ implementation
              inserttypeconv_internal(hpp,sinttype);
              inserttypeconv_internal(hpp,sinttype);
            end;
            end;
 
 
-         { addition/substraction depending on inc/dec }
+         { addition/subtraction depending on inc/dec }
          if inlinenumber = in_inc_x then
          if inlinenumber = in_inc_x then
            hpp := caddnode.create_internal(addn,hp,hpp)
            hpp := caddnode.create_internal(addn,hp,hpp)
          else
          else