Is There a Way to Disable Code Optimization in VectorCast?

  • Thread starter Thread starter rdsingh
  • Start date Start date
  • Tags Tags
    Vector
Click For Summary
The discussion centers on issues encountered while using the VectorCast tool for unit testing C code, specifically regarding automatic code optimization at the disassembly level. The function ffx_ScheduleInsertCCEvent() contains an if condition that is not being executed due to optimization, leading to the relevant code not appearing in the disassembly during debugging. Consequently, the FM_ASSERTION_RESET_FAULT is not triggered, resulting in abnormal termination of the test case. A suggested solution involves checking the VectorCast documentation for options to disable code optimization, potentially through compiler flags. This would allow the problematic code to be visible and executed during testing.
rdsingh
Messages
1
Reaction score
0
I am using VectorCast tool to Unit Test the code written in C language.

Brief Description:-The following piece of code (which is present in source code) is getting optimized in VectorCast at Disassembly Level. Hence, the code is not even visible in VectorCast Disassembly.

Details:-

In Function ffx_ScheduleInsertCCEvent() :- The Following Code is getting Optimized in VectorCast automatically and hence, the If condition is not getting hit.

if ( FFX_Scheduler.PendingCCFreeList == NULL )
{
#ifdef SIMULATION_BUILD
TRAP();
#else
FM_ASSERTION_RESET_FAULT( AF_FFX_PCCLIST_OVERFLOW, (UINT32) Signal, callers_address() );
#endif
}

Due to the Code Optimization by VectorCast, the piece of code is not visible in the Disassembly while debugging. Plus, the FM_ASSERTION_RESET_FAULT is not getting hit and the Test case is getting terminated Abnormally.

Does anybode has a solution to this problem.
 
Technology news on Phys.org
I'm not familiar with VectorCast, but is there some way to turn off code optimization? I would think there's a flag you could set when the code is compiled. I would take a look at the documentation for this tool to see if that is a possibility.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 54 ·
2
Replies
54
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K