Re: RFA: fix rtl-optimization/56833

2013-05-28 Thread Andreas Schwab
Joern Rennecke writes: > 2013-05-24 Joern Rennecke > > PR rtl-optimization/56833 > * postreload.c (move2add_record_mode): New function. > (move2add_record_sym_value, move2add_valid_value_p): Likewise. > (move2add_use_add2_insn): Use move2add_record_sym_value. > (mo

Re: RFA: fix rtl-optimization/56833

2013-05-27 Thread Eric Botcazou
> Please find attached the updated patch. Thanks. Still, although reg_mode[regno] is indeed tested above, in + for (i = hard_regno_nregs[regno][mode] - 1; i > 0; i--) +if (reg_mode[i] != BLKmode) + return false; this should be reg_mode[regno + i] instead of reg_mode[i]. And one the n

Re: RFA: fix rtl-optimization/56833

2013-05-24 Thread Joern Rennecke
Please find attached the updated patch. bootstrapped / regtested for i686-pc-linux-gnu regtested for i686-pc-linux-gnu X sh-elf regtested in gcc 4.8 branch for i686-pc-linux-gnu X avr (--target-board atmega128-sim) 2013-05-24 Joern Rennecke PR rtl-optimization/56833 * postrel

Re: SUBREGs in move2add_note_store (Was: Re: RFA: fix rtl-optimization/56833)

2013-05-24 Thread Joern Rennecke
Quoting Eric Botcazou : +static bool +move2add_valid_value_p (int regno, enum machine_mode mode) [...] + for (i = hard_regno_nregs[regno][mode] - 1; i > 0; i--) +if (reg_mode[i] != BLKmode) + return false; I think that a 'regno' is missing in the second hunk. Huh? Could you be more

Re: SUBREGs in move2add_note_store (Was: Re: RFA: fix rtl-optimization/56833)

2013-05-24 Thread Eric Botcazou
> I've found it is good to have also one mode to invalidate a register for > all uses; it seems natural to use VOIDmode for that, and then we can use > BLKmode for all but the first hard register of a multi-hard-reg register. OK, that sounds sensible. > I have attached the patch that makes the re

SUBREGs in move2add_note_store (Was: Re: RFA: fix rtl-optimization/56833)

2013-05-23 Thread Joern Rennecke
Quoting Joern Rennecke : Looking into sharing the code with sites that perform essentially the same function but look somewhat different, I see there's a problem with using only reg_set_luid to indicate the consistency of a multi-hard-reg-value in these other contexts. For values that are use a

Re: RFA: fix rtl-optimization/56833

2013-05-23 Thread Joern Rennecke
Quoting Eric Botcazou : The patch is OK on principle, but can you factor out the common code? The endings of move2add_use_add2_insn and move2add_use_add3_insn are identical so it would be nice to have e.g. a record_reg_value helper function and call it from there. Similarly, the 3 new checks l

Re: RFA: fix rtl-optimization/56833

2013-05-23 Thread Eric Botcazou
> But I can see that there could be a problem with an earlier value > that used to be valid in a multi-hard-register sub register to be > considered to be still valid. > Setting the mode of every constituent register but the first one > (which has the new value recorded) to VOIDmode at the same tim

Re: RFA: fix rtl-optimization/56833

2013-05-22 Thread Joern Rennecke
Quoting Eric Botcazou : The problem was that we had some optimzations added to the reload_cse_move2add pass that would attempt transformations with multi-hard-register registers, without keeping track of the validity of the values in all hard registers involved. That's not clear to me: for exa

Re: RFA: fix rtl-optimization/56833

2013-05-22 Thread Eric Botcazou
> The problem was that we had some optimzations added to the > reload_cse_move2add pass that would attempt transformations with > multi-hard-register registers, without keeping track of the validity of the > values in all hard registers involved. That's not clear to me: for example in move2add_not

RFA: fix rtl-optimization/56833

2013-05-15 Thread Joern Rennecke
The problem was that we had some optimzations added to the reload_cse_move2add pass that would attempt transformations with multi-hard-register registers, without keeping track of the validity of the values in all hard registers involved. The attached patch fixes this by updating reg_set_luid for