| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| RainerGund 
 
 
 Joined: 15 Oct 2003
 Posts: 1
 Location: Wiesenbach, Germany
 
 
			      
 
 | 
			
				| Optimization levels |  
				|  Posted: Wed Mar 31, 2004 12:50 am |   |  
				| 
 |  
				| Hi, 
 is there any further explanation about the functionality of the different optimization levels ?
 Will it have any effect on code or memory size by changing it on the same source code ?
 
 Tanks
 
 R.Gund
 |  | 
	
		|  | 
	
		| Haplo 
 
 
 Joined: 06 Sep 2003
 Posts: 659
 Location: Sydney, Australia
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 31, 2004 2:23 am |   |  
				| 
 |  
				| Yes it does have big effects on the code/memory size. I've experienced size differences up to %10 between #opt 0 and #opt 9 on the same source code. |  | 
	
		|  | 
	
		| ajt 
 
 
 Joined: 07 Sep 2003
 Posts: 110
 
 
 
			    
 
 | 
			
				| Optimization Levels |  
				|  Posted: Wed Mar 31, 2004 11:19 pm |   |  
				| 
 |  
				| Not clear why one would ever want to set a low optimization level unless this directive is the same as "bug threshold"  (or inverse thereof).  The manual says that the directive "may also be used if an optimization error is suspected"! 
 So how is one to know what to use so as to not incur latent bugs!?!
 _________________
 Al Testani
 |  | 
	
		|  | 
	
		| regan 
 
 
 Joined: 10 Sep 2003
 Posts: 5
 Location: Wellington, New Zealand
 
 
			      
 
 | 
			
				| Optimisation Levels |  
				|  Posted: Thu Apr 01, 2004 2:28 am |   |  
				| 
 |  
				| The optimisation levels are important to me at the moment as there is a bug in some of the RAM addressing in the most recent version of the PCH compiler.  To get around it I need to set the opt level to 5 which uses 'conservative' switching of RAM banks.  This has the undesirable effect of increasing my code size by over 12%.  Meanwhile, I still have useable code until CCS find time to fix the bug.  Normally, I would set the opt level to as high as possible. 
 Regan.
 |  | 
	
		|  | 
	
		|  |