<div dir="ltr">Does anyone have any tips on how to debug an issue that only arises when GCC optimisation is increased from -O0 to -O1 (or above).<div><br></div><div>I have an issue with the hardware jpeg encoder on an stm32f7 MCU when I crank up the optimise (the first time I've tried it as I prefer -O0 for debugging). I've tried putting:<br>     #pragma GCC optimize("O0")<br></div><div>at the start of the 3 files that directly implement the jpeg stuff to turn off optimise on them as it looks like the conversion functions that generate the YCbCr 4:2:0 data from the ARGB8888 ready for the hardware engine have bits optimised away!</div><div><br></div><div>I would expect the lookup tables generated by the code for these conversions would be the same irrespective of optimisation level but that's the only place I can think to look (the '.lst' files output from the compiler are way too different to make any sensible comparisons between optimisation levels)</div><div><br></div><div>Ideas? Cheers</div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Robin Gilks<div><br></div></div></div></div></div>