This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hi!
We have a sw system for TMS320C6713 compiled from C/C++ source, and we are using optimization level 3. We have just put a lot of effort into searching for the cause of a rare event where the DSP enters an interrupt function and the B14 (assigned as Datapage Pointer DP) register no longer points to the start of static memory (in our case 0x2C1C0), causing sw hang or crash. Using CCS, the call stack pointed at a specific loop, and IRP (Interrupt Return Pointer) pointed at the blue line below (MV .L2X A4,B11). The (red) line above shows that the compiler has decided to run in parallel both IRQ disable and B14 (=DP) modification. In the interrupt function, both GIE and PGIE bits are zero. To our understanding, the parallel execution of IRQ disable and B14 modification makes it possible to enter the interrupt handler just before IRQ is disabled, but at the same time, B14 modification is executed, so that at the beginning of the interrupt function, the B14 content is "ruined" since it is no longer holding value 0x2c1C0. This is the only explanation that can explain our observations. We have observed this *.asm output both for version 7.4.13 and the latest 7.4.24 version of the TI C++ compiler. The v8.3.x compiler do not support C6713. Is this reported before? Our current fix is to apply option --interrupt_threshold=<some value> for the affected *.cpp files, so that this type of optimiztion do not take place.
Best regards
Arne Lie, SINTEF Digital
MVC .S2 CSR,B6
|| LDW .D1T1 *++A11(8),A3 ; |1112| (P) <0,0>
|| MV .L1X DP,A13 ; save dp
AND .L2 -2,B6,B4
MVC .S2 B4,CSR ; interrupts off
|| LDW .D1T2 *+A11(4),DP ; |1112| (P) <0,2>
MV .L2X A4,B11
MV .L2X A12,B12
I'm sure this problem was very difficult to track down. I appreciate your effort.
For the source file that is built when this problem assembly code ...
Arne Lie said:MVC .S2 B4,CSR ; interrupts off
|| LDW .D1T2 *+A11(4),DP ; |1112| (P) <0,2>MV .L2X A4,B11
MV .L2X A12,B12
... is generated, please follow the directions in the article How to Submit a Compiler Test Case.
Thanks and regards,
-George
Dear George,
Thanks for redirecting me to the appropriate web site. Since TI asks for how to recreate the issue, and our client do not want to share proprietary sw code, do you have any suggestions how to preceed without having to put a lot of efforts into modifying our code tohide sensitive algorithms but still produce the same issue?
best regards
Arne, SINTEF Digital
Did you notice the sub-chapter in the article on submitting the test case titled Protecting Intellectual Property? It talks about how to remove comments from the code, and how to send the test case just to me. Does that help?
Based on past experience, it is very unlikely you will find a way to generate the problem assembly sequence using anything other than the C code that does it now.
Thanks and regards,
-George
And sometimes when stripping out extraneous code to get a small test case that shows the problem, you find what the problem is.
Dear George,
I have followed your guides and produced the needed input. However, our client has revised this input and has objected to its submission to TI without an NDA. So, I am sorry to say that our conclusion is that we will not file the needed input for you to recreate this issue. We will use that --interrupt_threshold option and inspect new compilations via file search as a workaround.
best regards
Arne Lie
SINTEF Digital