This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping: [patch, avr] Fix unrecognizable insn ICE for avr (PR71103)
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Pitchumani Sivanupandi <pitchumani dot sivanupandi at atmel dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 21 May 2016 13:49:12 +0300
- Subject: Re: Ping: [patch, avr] Fix unrecognizable insn ICE for avr (PR71103)
- Authentication-results: sourceware.org; auth=none
- References: <1463750021 dot 2324 dot 10 dot camel at atmel dot com>
2016-05-20 16:13 GMT+03:00 Pitchumani Sivanupandi
<pitchumani.sivanupandi@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 <pitchumani.s@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 <pitchumani.s@atmel.com>
>
> PR target/71103
> * gcc.target/avr/pr71103.c: New test.
Committed.
PS: I'm sorry for long delay. I was at vacation.