Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#3082 closed defect (fixed)

record/array codegen error

Reported by: Lennart Ochel Owned by: Mahder Alemseged Gebremedhin
Priority: high Milestone: 1.9.4
Component: Code Generation Version: trunk
Keywords: Cc: Mahder Alemseged Gebremedhin

Description

The following model produces codegen error:

model foo
  goo[3] x;

  record goo
    Real r;
  end goo;
algorithm
  for i in 1:3 loop
    x[i].r := i;
  end for;
end foo;
/*
 equation index: 1
 type: ALGORITHM
 
   for i in 1:3 loop
     x[i].r := (*Real*)(i);
   end for;
 */
void foo_eqFunction_1(DATA *data)
{
  const int equationIndexes[2] = {1,1};
  TRACE_PUSH
  modelica_integer tmp0;
  modelica_integer tmp1;
  modelica_integer tmp2;
  tmp0 = (modelica_integer) 1; tmp1 = 1; tmp2 = (modelica_integer) 3;
  if(!tmp1)
  {
    FILE_INFO info = omc_dummyFileInfo;
    omc_assert(threadData, info, "assertion range step != 0 failed");
  }
  else if(!(((tmp1 > 0) && (tmp0 > tmp2)) || ((tmp1 < 0) && (tmp0 < tmp2))))
  {
    modelica_integer $Pi;
    for($Pi = (modelica_integer) 1; in_range_integer($Pi, tmp0, tmp2); $Pi += tmp1)
    {
      $Px$lB(modelica_integer)$Pi$rB$Pr = ((modelica_real)(modelica_integer)$Pi);
    }
  }
  TRACE_POP
}

This line is not valid:

$Px$lB(modelica_integer)$Pi$rB$Pr = ((modelica_real)(modelica_integer)$Pi);

Change History (6)

comment:1 by Lennart Ochel, 10 years ago

Resolution: duplicate
Status: newclosed

see #2756

comment:2 by Mahder Alemseged Gebremedhin, 10 years ago

Resolution: duplicate
Status: closedreopened

comment:3 by Mahder Alemseged Gebremedhin, 10 years ago

Owner: changed from Lennart Ochel to Mahder Alemseged Gebremedhin
Status: reopenedassigned

comment:4 by Mahder Alemseged Gebremedhin, 10 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by Dietmar Winkler, 9 years ago

Milestone: Futurepre1.9.4

It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.

comment:6 by Martin Sjölund, 7 years ago

Milestone: pre1.9.41.9.4

Removing the pre1.9.4 milestone in favor of 1.9.4.

Note: See TracTickets for help on using tickets.