2019-05-06 04:54 PM
I have optimisation set to -o2 and every other Property and Preference is default. Processor is a H750. My code has a time critical inner loop which seems to vary from 14 up to 26 instructions for the same code, varying solely on the time of day when it was compiled. Is there something random in the way the compiler begins its optimisation and if so is this something I can turn off ?
2019-05-08 04:47 AM
Solved sort of if anyone else has a similar problem. There appears to be some randomness in the order entries are made in the indirection table after each subroutine, and as the whole function was quite large this in turn was creating a cascade effect on how these indirection values were accessed from my inner loop. Moving the inner loop to its own function solved the problem. Obviously this adds a function call but the inner loop (now 13 instructions !) is performed 10 times for each call so its a huge gain. I would have thought the compiler could have noticed this problem and done this itself.
2019-05-08 07:37 AM
Are you able to extract the code that gives different results?
Could you send that piece of the code to me so I can try to replicate?
Sounds very weird, our test suites were ran successfully and we have not received any similar reports.
2019-05-08 07:49 AM
Problem is as soon as I extract a code segment, it compiles correctly. I assume it's some sort of code size/position dependancy. Let me see if I can create something not too large that shows the problem. How do I send code directly to you ?
2019-05-08 08:36 AM
You should be able to click my name to go to my profile and there you can send "Message" to send it privately to me. Alternatively my mail is listed there as well.