2016-05-20 16:13 GMT+03:00 Pitchumani Sivanupandi <pitchumani.sivanupa...@atmel.com>: > Ping! > > Note: Removed the garbled characters and added ChangeLog > ---------------------------------------------------------- > avr-gcc crashes for following test as it couldn't recognize the > instruction pattern. > > struct st { > unsigned char uc1; > unsigned int *ui1; > }; > > unsigned int ui1; > struct st foo () { > struct st ret; > ret.uc1 = 6; > ret.ui1 = &ui1; > return ret; > } > > $ avr-gcc -mmcu=atmega328p -O1 test.c > (-- snip --) > test.c: In function 'foo': > test.c:12:1: error: unrecognizable insn: > } > ^ > (insn 6 5 7 2 (set (subreg:QI (reg:PSI 42 [ D.1499 ]) 1) > (subreg:QI (symbol_ref:HI ("ui1") <var_decl 0x7fbf90532900 > ui1>) 0)) test.c:11 -1 > (nil)) > test.c:12:1: internal compiler error: in extract_insn, at recog.c:2287 > 0xd51195 _fatal_insn(char const*, rtx_def const*, char const*, int, > char const*) > /home/rudran/code/gcc/gcc/rtl-error.c:108 > (--snip--) > > There is no valid pattern in avr to match the "subreg:QI > (symbol_ref:HI)". Attached patch forces the symbol_ref of subreg > operand to register so that it will become register operand and movqi > pattern shall recognize it. > > Ran gcc regression test with internal simulators. No new regressions > found. > > If Ok, could someone commit please? > > Regards, > Pitchumani > > gcc/ChangeLog > 2016-05-20 Pitchumani Sivanupandi <pitchuman...@atmel.com> > > PR target/71103 > * config/avr/avr.md (define_expand "mov<mode>"): If the source > operand is > subreg (symbol_ref) then move the symbol ref to register. > > gcc/testsuite/ChangeLog > 2016-05-20 Pitchumani Sivanupandi <pitchuman...@atmel.com> > > PR target/71103 > * gcc.target/avr/pr71103.c: New test.
Committed. PS: I'm sorry for long delay. I was at vacation.