﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3530	"""comSubExp"" introduces bad alias variables in certain cases"	Lennart Ochel	Volker Waurich	"The following model can be used to illustrate the issue:
{{{#!mo
model test
  Real x[2];
  Real a[2];
  Real z;
  parameter Real t0 = 0.5;
  Boolean b[2];
  Integer j;
  Real t[2];
equation
  x[1] = t[2];
  x[2] = t[1];
  a[1] = if time<t0 then 1.0 else sin(time);
  a[2] = if time<t0 then 1.0 else time^2;
  x[1] = a[1]+a[2];
  x[2]-a[2] = a[1];
  der(z) = x[1]/x[2];
  j = 1+integer(time);
algorithm
  if t[j] < time then
    b[j] := true;
  end if;
end test;
}}}

The module ""comSubExp"" introduces {{{t[1]}}} as alias variable, which makes the generated c code invalid, since it occurs in an if condition where it cannot be substituted. "	defect	closed	high	1.9.4	Backend		fixed		Volker Waurich
