Re: Redundant / wasted stack space and instructions

2014-04-16 Thread Jeff Law
On 04/16/14 00:30, pshor...@dataworx.com.au wrote: I had left the movsi patterns unimplemented because I was told that if I did this then gcc would create expands/splits to use 16 bit moves. So, I removed my movsi patterns and all seemed well. Correct. GCC can synthesize movsi from movhi. How

Re: Redundant / wasted stack space and instructions

2014-04-15 Thread pshortis
For small micros such as MSP430 & friends and many of the Renasis MCUs, some of which only have 2K or ram on board, this could be a real issue. Although I reproduced the same behaviour on i386 using a stock compiler, I was wondering if there was something missing in my port that prevents spill

Re: Redundant / wasted stack space and instructions

2014-04-14 Thread pshortis
On 15.04.2014 12:54, Jeff Law wrote: On 04/14/14 18:58, pshor...@dataworx.com.au wrote: I'm porting to a 16 bit micro and noticed that when optimization is enabled (function.c:2101), most (non-volatile, non-addressed) stack variables are copied into virtual registers. I assume this is so the reg

Re: Redundant / wasted stack space and instructions

2014-04-14 Thread Jeff Law
On 04/14/14 18:58, pshor...@dataworx.com.au wrote: I'm porting to a 16 bit micro and noticed that when optimization is enabled (function.c:2101), most (non-volatile, non-addressed) stack variables are copied into virtual registers. I assume this is so the register allocator will attempt to alloca