Skip to content

Commit

Permalink
- compile without optimizations for bootstrapping
Browse files Browse the repository at this point in the history
- better handling of verification of if equations that do not "set" anything i.e. (x = y):
  if cond 
  then reinit(v, 0); reinit(s, 1);
  else reinit(v, 2); reinit(s, 3);
  end if;
  maybe we should also check if the same reinit variables are used in the if branches (no idea what the spec says).
  unfortunately the back-end doesn't support yet reinit inside if equations in when clauses.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22043 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Aug 28, 2014
1 parent 23bb4be commit ad76695
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Compiler/FrontEnd/DAEUtil.mo
Expand Up @@ -3002,12 +3002,27 @@ algorithm (outrefs,matching) := matchcontinue(inCrefs)
equation
(recRefs,b3) = compareCrefList(llrefs);
i = listLength(recRefs);
b1 = (0 == intMod(listLength(crefs),listLength(recRefs)));
// make sure is more than 0!
true = intGt(i, 0);
b1 = (0 == intMod(listLength(crefs),i));
crefs = List.unionOnTrueList({recRefs,crefs},ComponentReference.crefEqual);
b2 = intEq(listLength(crefs),i);
b1 = boolAnd(b1,boolAnd(b2,b3));
then
(crefs,b1);

// this deals with 0 as the number of set crefs in one of the branches, for example:
// if then reinint;reinit; else reinit;reinit; end if;
case(crefs::llrefs)
equation
(recRefs,b3) = compareCrefList(llrefs);
i = listLength(recRefs);
// make sure both of them are 0!
true = intEq(i, 0);
true = intEq(listLength(crefs), 0);
then
(crefs,true);

end matchcontinue;
end compareCrefList;

Expand Down

0 comments on commit ad76695

Please sign in to comment.