diff --git a/Compiler/BackEnd/CommonSubExpression.mo b/Compiler/BackEnd/CommonSubExpression.mo index 65363d8d916..a981faa315b 100644 --- a/Compiler/BackEnd/CommonSubExpression.mo +++ b/Compiler/BackEnd/CommonSubExpression.mo @@ -1212,15 +1212,15 @@ algorithm //eqAtts := List.threadMap(List.fill(false, arrayLength(m)), List.fill("", arrayLength(m)), Util.makeTuple); //BackendDump.dumpBipartiteGraphStrongComponent2(pathVars, eqs, m, varAtts, eqAtts, "shortenPaths"+stringDelimitList(List.map(partition,intString),"_")); - for varIdx in List.intRange(arrayLength(mT)) loop - adjEqs := arrayGet(mT,varIdx); + for idx in 1:arrayLength(mT) loop + adjEqs := arrayGet(mT,idx); if listLength(adjEqs)==2 then //print("varIdx1 "+intString(varIdx)+"\n"); //print("adjEqs "+stringDelimitList(List.map(adjEqs,intString),",")+"\n"); adjEqs := List.map1(adjEqs,List.getIndexFirst,partition); adjEqs := List.map1(adjEqs, Array.getIndexFirst, eqMap); - varIdx := arrayGet(pathVarIdxMap,varIdx); + varIdx := arrayGet(pathVarIdxMap,idx); cses := SHORTCUT_CSE(adjEqs,varIdx)::cses; end if; end for; //end the variables diff --git a/Compiler/BackEnd/EvaluateFunctions.mo b/Compiler/BackEnd/EvaluateFunctions.mo index b9bf9f468ae..eb4bbdf7070 100644 --- a/Compiler/BackEnd/EvaluateFunctions.mo +++ b/Compiler/BackEnd/EvaluateFunctions.mo @@ -2288,7 +2288,7 @@ algorithm (start,stop,step) := getRangeBounds(range); true := intEq(step,1); repl := replIn; - for i in List.intRange2(start,stop) loop + for i in start:stop loop repl := BackendVarTransform.addReplacement(repl, ComponentReference.makeCrefIdent(iter,DAE.T_INTEGER_DEFAULT,{}),DAE.ICONST(i),NONE()); (stmts,((_,repl,_))) := evaluateFunctions_updateStatement(stmtsIn,(funcTreeIn,repl,i),{}); diff --git a/Compiler/BackEnd/IndexReduction.mo b/Compiler/BackEnd/IndexReduction.mo index 79f9f802a17..4912e6f9718 100644 --- a/Compiler/BackEnd/IndexReduction.mo +++ b/Compiler/BackEnd/IndexReduction.mo @@ -1411,7 +1411,7 @@ protected Integer size, numEqs, e; algorithm numEqs := arrayLength(inOrgEqns); - for e in List.intRange(numEqs) loop + for e in 1:numEqs loop orgeqns := arrayGet(inOrgEqns,e); size := BackendEquation.equationLstSize(orgeqns); oCount := oCount + size; @@ -1432,7 +1432,7 @@ protected algorithm outOrgEqns := inOrgEqns; numEqs := arrayLength(inOrgEqns); - for e in List.intRange(numEqs) loop + for e in 1:numEqs loop orgeqns := arrayGet(inOrgEqns,e); (orgeqns,_) := BackendInline.inlineEqs(orgeqns, inA,{},false); arrayUpdate(outOrgEqns,e,orgeqns); @@ -2849,7 +2849,7 @@ protected algorithm outOrgEqns := inOrgEqns; numEqs := arrayLength(inOrgEqns); - for e in List.intRange(numEqs) loop + for e in 1:numEqs loop orgeqns := arrayGet(outOrgEqns,e); if not listEmpty(orgeqns) then (outEqnsLst, orgeqns) := match orgeqns diff --git a/Compiler/FrontEnd/Expression.mo b/Compiler/FrontEnd/Expression.mo index 124acea69bf..6225f7b38af 100644 --- a/Compiler/FrontEnd/Expression.mo +++ b/Compiler/FrontEnd/Expression.mo @@ -1707,10 +1707,9 @@ algorithm dims := expDimensions(eIn); try {DAE.DIM_INTEGER(integer=size)} := dims; - for i in List.intRange(size) loop + for i in size:-1:1 loop eLstOut := makeASUBSingleSub(eIn,DAE.ICONST(i))::eLstOut; end for; - eLstOut := listReverse(eLstOut); else eLstOut := {}; end try;