Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 14:20, Ian Lance Taylor wrote: -fsplit-wide-types is an improvement on most targets, in which ints and pointers have the size UNITS_PER_WORD. On AVR that appears not to be the case, and it seems possible that AVR should set flag_split_wide_types to 0 in TARGET_OPTION_OPTIMIZATION_TA

Re: avr compilation

2011-03-18 Thread Ian Lance Taylor
"Paulo J. Matos" writes: >> Without splitting HI the moves will disappear, try -fno-split-wide-types. >> > > It does work! It's enabled by -O1, maybe it should be disabled by -Os > if it improves the code size consistently. -fsplit-wide-types is an improvement on most targets, in which ints and

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 13:26, Georg-Johann Lay wrote: note that the last moves are two QI moves, the add is HI. Yes, correct, this seems to cause some confusion on gcc side then... humm! Without splitting HI the moves will disappear, try -fno-split-wide-types. It does work! It's enabled by -O1, mayb

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 12:10, David Brown wrote: If you are digging through the AVR backend and find ways to improve code sequences like this, the avr-gcc community would be very grateful. There is an avr-gcc mailing list at , which may be of interest

Re: avr compilation

2011-03-18 Thread Georg-Johann Lay
Paulo J. Matos schrieb: > Hi all, > > I am looking at the avr backend in order to try to sort some things out > on my own backend. > > One of the tests I am doing is by compiling the following: > int x = 0x1010; > int y = 0x0101; > > int add(void) > { > return x+y; > } > > It compiles to (in

Re: avr compilation

2011-03-18 Thread David Brown
On 18/03/2011 11:15, Paulo J. Matos wrote: On 18/03/11 10:08, WANG.Jiong wrote: This may related with subreg regmove finding Suggest specifiy -fdump-rtl-regmove to see what happen after this pass Maybe avr need a target dependent regmove pass to handle this It doesn't look like it's regmove,

Re: avr compilation

2011-03-18 Thread Paulo J. Matos
On 18/03/11 10:08, WANG.Jiong wrote: This may related with subreg regmove finding Suggest specifiy -fdump-rtl-regmove to see what happen after this pass Maybe avr need a target dependent regmove pass to handle this It doesn't look like it's regmove, whose result looks pretty sane: ;; Pred edge

Re: avr compilation

2011-03-18 Thread WANG.Jiong
This may related with subreg regmove finding Suggest specifiy -fdump-rtl-regmove to see what happen after this pass Maybe avr need a target dependent regmove pass to handle this Best, Jiong On 03/18/2011 04:47 PM, Paulo J. Matos wrote: Hi all, I am looking at the avr backend in order to try t

avr compilation

2011-03-18 Thread Paulo J. Matos
Hi all, I am looking at the avr backend in order to try to sort some things out on my own backend. One of the tests I am doing is by compiling the following: int x = 0x1010; int y = 0x0101; int add(void) { return x+y; } It compiles to (in gcc-4.3.5_avr with -Os) add: /* prologue: function