Opened 9 years ago

Last modified 9 years ago

#3711 new defect

Cpp runtime test recordTupleReturnTest fails if wrapFunctionCalls is enabled

Reported by: Lennart Ochel Owned by: somebody
Priority: high Milestone: Future
Component: Cpp Run-time Version: v1.9.4-dev-nightly
Keywords: Cc: Rüdiger Franke, jan.hagemann@…, Volker Waurich

Description

I don't really know why the cpp runtime test recordTupleReturnTest fails if post-optimization module wrapFunctionCalls is enabled (just pass --postOptModules+=wrapFunctionCalls). Can someone have a look?
BTW: The test fails for c runtime anyway.

Change History (2)

comment:1 by Lennart Ochel, 9 years ago

Cc: Volker Waurich added

comment:2 by Rüdiger Franke, 9 years ago

It was me who added the test after having had fixed the template writeLhsCref for the Graetz example, see:
https://github.com/OpenModelica/OMCompiler/commit/3a46e9d1b94abbea58e8070788e88f30029a0728

I don't really know the answer to your question. Let me elaborate a bit. Without wrapFunctionCalls we generate the code:

struct RecordTupleReturn_RType
{
  StatArrayDim1<double,3> a;
  double u;
};
RecordTupleReturn_RType r2;
r2 = get<1>(tmp3.data) /*writeLhsCref1*/;

Meaning that we have a simple assignment to a the cref. RType somehow disappears with wrapFunctionCalls. The error message says:

UNHANDLED: RecordTupleReturn.R($cse2.u, {r.a[1], r.a[2], r.a[3]}) = get<1>(tmp0.data)

There is no case for this more complex assignment in the match statement.

Note: See TracTickets for help on using tickets.