Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-14 Thread Jeff Law
On 10/13/14 18:16, Joern Rennecke wrote: On 13 October 2014 20:43, Jeff Law l...@redhat.com wrote: ... I think you want smode in the mode_for_size call rather than mode, right (both instances)? No, nregs is the number of hard registers of regno in mode. Hence we must use the size of mode.

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-13 Thread Jeff Law
On 10/11/14 03:32, Joern Rennecke wrote: On 10 October 2014 21:13, Jeff Law l...@redhat.com wrote: ... ISTM it would be better to find the mode of the same class that corresponds to GET_MODE_SIZE (mode) / nregs. In your case that's obviously QImode :-) Like this? Or did you mean to remove

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-13 Thread Joern Rennecke
On 13 October 2014 20:43, Jeff Law l...@redhat.com wrote: ... I think you want smode in the mode_for_size call rather than mode, right (both instances)? No, nregs is the number of hard registers of regno in mode. Hence we must use the size of mode. How to choose the mode class is not so

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-11 Thread Joern Rennecke
On 10 October 2014 21:13, Jeff Law l...@redhat.com wrote: ... ISTM it would be better to find the mode of the same class that corresponds to GET_MODE_SIZE (mode) / nregs. In your case that's obviously QImode :-) Like this? Or did you mean to remove the save_mode[regno] use altogether? I can

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-10 Thread Jeff Law
On 10/07/14 15:56, Joern Rennecke wrote: On 7 October 2014 18:38, Jeff Law l...@redhat.com wrote: On 10/06/14 20:57, Joern Rennecke wrote: On 6 October 2014 19:58, Jeff Law l...@redhat.com wrote: What makes word_mode special here? ie, why is special casing for word_mode the right thing to

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-07 Thread Jeff Law
On 10/06/14 20:57, Joern Rennecke wrote: On 6 October 2014 19:58, Jeff Law l...@redhat.com wrote: What makes word_mode special here? ie, why is special casing for word_mode the right thing to do? The patch does not special-case word mode. The if condition tests if smode would cover multiple

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-07 Thread Joern Rennecke
On 7 October 2014 18:38, Jeff Law l...@redhat.com wrote: On 10/06/14 20:57, Joern Rennecke wrote: On 6 October 2014 19:58, Jeff Law l...@redhat.com wrote: What makes word_mode special here? ie, why is special casing for word_mode the right thing to do? The patch does not special-case

RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-06 Thread Joern Rennecke
Investigating an ICE while trying to compile libgcc2.c:__udivmoddi4 for a new avr variant with different register set/allocation order, I found replace_reg_with_saved_mem falling over its own nonsense. The instruction: (debug_insn 97 96 98 2 (var_location:SI __x2 (mult:SI (lshiftrt:SI (reg/v:SI

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-06 Thread Jeff Law
On 10/06/14 02:51, Joern Rennecke wrote: Investigating an ICE while trying to compile libgcc2.c:__udivmoddi4 for a new avr variant with different register set/allocation order, I found replace_reg_with_saved_mem falling over its own nonsense. The instruction: (debug_insn 97 96 98 2

Re: RFA: fix mode confusion in caller-save.c:replace_reg_with_saved_mem

2014-10-06 Thread Joern Rennecke
On 6 October 2014 19:58, Jeff Law l...@redhat.com wrote: What makes word_mode special here? ie, why is special casing for word_mode the right thing to do? The patch does not special-case word mode. The if condition tests if smode would cover multiple hard registers. If that would be the case,