We're having a problem with the HCS08 compiler as we migrate from CodeWarrior v3.1 to v5.1. We're seeing some cases where the newer compiler, even for very simple C code, appears to produce assembler that messes about unnecessarily with saving the X register to the stack, and restoring it from the stack when it hasn't actually been changed.
The two examples attached show the sort of thing that we're seeing, compiled using both CW 3.1 and 5.1 with the same compiler options (-Cs08 -Ms -Ot -OiLib -Or -TE1uE).
I'd be very grateful for any advice or suggestions on how to make the newer compiler behave properly in these kind of situations.
Many thanks!
Richard
 
					
				
		
 CompilerGuru
		
			CompilerGuru
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Message Edited by RichardB on 2006-09-13 08:38 AM
 
					
				
		
 CompilerGuru
		
			CompilerGuru
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 
					
				
		
 CompilerGuru
		
			CompilerGuru
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Message Edited by RichardB on 2006-09-08 05:36 AM
