Skip to content

Commit

Permalink
Return correct variability for reductions
Browse files Browse the repository at this point in the history
If either the expression or the iterator is parameter, the entire
expression has that variability (or lower). This fixes ticket:4550

Belonging to [master]:
  - OpenModelica/OMCompiler#1870
  - OpenModelica/OpenModelica-testsuite#727
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Oct 18, 2017
1 parent b610cb9 commit 15730cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -1350,7 +1350,7 @@ algorithm
inDoVect, inPrefix, inInfo);

// Figure out the type of the reduction.
c := exp_const; // Types.constAnd(exp_const, iter_const);
c := Types.constAnd(exp_const, iter_const);
fn := match inReductionFn
case Absyn.CREF_IDENT("$array",{}) then Absyn.IDENT("array");
else Absyn.crefToPath(inReductionFn);
Expand Down Expand Up @@ -1463,7 +1463,7 @@ algorithm
dim := DAE.DIM_UNKNOWN();
end if;

outConst := Types.constAnd(guard_const, iter_const);
outConst := Types.constAnd(outConst, Types.constAnd(guard_const, iter_const));
outIterators := DAE.REDUCTIONITER(iter_name, iter_exp, guard_exp, iter_ty) :: outIterators;
outDims := dim :: outDims;
end for;
Expand Down

0 comments on commit 15730cb

Please sign in to comment.