Skip to content

Commit

Permalink
- bugfix start value merging
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14319 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Dec 10, 2012
1 parent b3cc11e commit 9749e23
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Compiler/BackEnd/RemoveSimpleEquations.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1637,9 +1637,10 @@ algorithm
expcr = Expression.crefExp(cr);
pv = BackendVariable.getVarSharedAt(i2,ishared);
vsattr = addVarSetAttributes(pv,false,mark,simpleeqnsarr,EMPTYVARSETATTRIBUTES);
vsattr = addVarSetAttributes(v,negate,mark,simpleeqnsarr,vsattr);
rows = List.removeOnTrue(r,intEq,iMT[i]);
_ = arrayUpdate(iMT,i,{});
(vars,eqnslst,shared,repl,vsattr) = traverseAliasTree(rows,i,exp,SOME(expcr),negate,true,mark,simpleeqnsarr,iMT,unreplacable,vars,eqnslst,shared,repl,vsattr);
(vars,eqnslst,shared,repl,vsattr) = traverseAliasTree(rows,i,exp1,SOME(expcr),negate,true,mark,simpleeqnsarr,iMT,unreplacable,vars,eqnslst,shared,repl,vsattr);
then
(vars,eqnslst,shared,repl);
// time set
Expand All @@ -1655,10 +1656,10 @@ algorithm
replacable = replaceableAlias(v,unreplacable);
(vars,eqnslst,shared,repl) = handleSetVar(replacable,v,i,source,exp1,iMT,iVars,iEqnslst,ishared,iRepl);
expcr = Expression.crefExp(cr);
vsattr = EMPTYVARSETATTRIBUTES;
vsattr = addVarSetAttributes(v,negate,mark,simpleeqnsarr,EMPTYVARSETATTRIBUTES);
rows = List.removeOnTrue(r,intEq,iMT[i]);
_ = arrayUpdate(iMT,i,{});
(vars,eqnslst,shared,repl,vsattr) = traverseAliasTree(rows,i,exp,SOME(expcr),negate,false,mark,simpleeqnsarr,iMT,unreplacable,vars,eqnslst,shared,repl,vsattr);
(vars,eqnslst,shared,repl,vsattr) = traverseAliasTree(rows,i,exp1,SOME(expcr),negate,false,mark,simpleeqnsarr,iMT,unreplacable,vars,eqnslst,shared,repl,vsattr);
then
(vars,eqnslst,shared,repl);
// constant set
Expand Down Expand Up @@ -1944,11 +1945,12 @@ algorithm
// negate if necessary
globalnegate1 = Util.if_(negate,not globalnegate,globalnegate);
exp1 = Debug.bcallret1(globalnegate1,Expression.negate,exp,exp);
crexp = Debug.bcallret1(negate,Expression.negate,crexp,crexp);
// replace alias with selected variable if replacable
source = Debug.bcallret3(replacable,addSubstitutionOption,optExp,crexp,source,source);
(vars,eqnslst,shared,repl) = handleSetVar(replacable,v,i,source,exp1,iMT,iVars,iEqnslst,ishared,iRepl);
vsattr = addVarSetAttributes(v,globalnegate,mark,simpleeqnsarr,iAttributes);
vsattr = addVarSetAttributes(v,globalnegate1,mark,simpleeqnsarr,iAttributes);
// negate if necessary
crexp = Debug.bcallret1(negate,Expression.negate,crexp,crexp);
rows = List.removeOnTrue(r,intEq,iMT[i]);
_ = arrayUpdate(iMT,i,{});
(vars,eqnslst,shared,repl,vsattr) = traverseAliasTree(rows,i,exp,SOME(crexp),globalnegate1,replaceState,mark,simpleeqnsarr,iMT,unreplacable,vars,eqnslst,shared,repl,vsattr);
Expand Down

0 comments on commit 9749e23

Please sign in to comment.