Middle-end might come up with hard registers as operands for expanders which clobber respective hard regs. This patch uses freshly created pseudos for respective expander operands and emits pseudo <-> hard move insn. Ok for 4.9.2? It's not yet for trunk because avr trunk backend is currently broken. Johann gcc/ PR63633 * config/avr/avr-protos.h (regmask): New inline function. (avr_fix_inputs, avr_emit3_fix_outputs): New protos. * config/avr/avr.c (avr_fix_operands, avr_move_fixed_operands) (avr_fix_inputs, avr_emit3_fix_outputs): New functions. * config/avr/avr-fixed.md (mulqq3_nomul, muluqq3_nomul) (mul3, mul3, 3, 3) (3, round3): Fix input operands. * config/avr/avr-dimode.md (add3, sub3) (3, 3, cbranch4) (3, mulsidi3): Fix input operands. * config/avr/avr.md (mulqi3_call, mulhi3_call, mulsi3, mulpsi3) (mulusi3, mulssi3, mulohisi3, mulhisi3) (usmulhisi3, mulhi3_highpart, mulsqipsi3) (fmul, fmuls, fmulsu): Fix operands. Turn insn into expander as needed. gcc/testsuite/ PR63633 * gcc.target/avr/torture/pr63633-ice-mult.c: New test.