Optimization issues

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Optimization issues

919 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Fri Aug 26 08:46:21 MST 2011
Linux build v 4.05 (bld 113)
LPC1758 custom hardware

Hi. 
I'm trying to dig into why a rather large application ~ 128k runs fine with no optimization but starts having issues when ANY compiler optimizations are enabled.

Its actually a bi-directional parallel interface to a DSP implemented using GPIOs that breaks.  I've looked at the GPIO signals with a scope but they don't appear to be changed significantly between the optimized and non-optimized versions of running code.  2 of the GPIOs are triggering interrupts to the LPC1758 when data is sent / acknowledged by the DSP. I'm not really using any wait loops other than sticking a few no-ops here and there to  stretch some signals.  But again, they don't appear to be distorted between the optimized and non-optimized versions.

Any thoughts on how to nail this down would be greatly appreciated!! 

-Wade
0 Kudos
Reply
3 Replies

910 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Fri Aug 26 15:56:24 MST 2011

Quote: JSalisbury
Hi,
Any voltile statements you have missed out?



+1 ... 95% of optimisation "issues" I've ever seen are because of a missing 'volatile'
0 Kudos
Reply

910 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Aug 26 10:15:51 MST 2011
This FAQ offers some advice:
http://support.code-red-tech.com/CodeRedWiki/CompilerOptimization
0 Kudos
Reply

910 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JSalisbury on Fri Aug 26 10:10:40 MST 2011
Hi,
Any voltile statements you have missed out?
0 Kudos
Reply