Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LRA: Check input insn pattern hard regs against early clobber hard re…
…gs for live info For the test case LRA generates wrong code for AVR cpymem_qi insn: (insn 16 15 17 3 (parallel [ (set (mem:BLK (reg:HI 26 r26) [0 A8]) (mem:BLK (reg:HI 30 r30) [0 A8])) (unspec [ (const_int 0 [0]) ] UNSPEC_CPYMEM) (use (reg:QI 52)) (clobber (reg:HI 26 r26)) (clobber (reg:HI 30 r30)) (clobber (reg:QI 0 r0)) (clobber (reg:QI 52)) ]) "t.c":16:22 132 {cpymem_qi} The insn gets the same value in r26 and r30. The culprit is clobbering r30 and using r30 as input. For such situation LRA wrongly assumes that r30 does not live before the insn. The patch is fixing it. gcc/ChangeLog: * lra-lives.cc (process_bb_lives): Check input insn pattern hard regs against early clobber hard regs. gcc/testsuite/ChangeLog: * gcc.target/avr/lra-cpymem_qi.c: New.
- Loading branch information