Thank you for the feedback. I did found the issue in mode_dependent_address_p hook.
//Claudiu > -----Original Message----- > From: Eric Botcazou [mailto:ebotca...@adacore.com] > Sent: Monday, March 31, 2014 10:21 PM > To: Claudiu Zissulescu > Cc: gcc@gcc.gnu.org; Francois Bedard; claz...@gmail.com > Subject: Re: VREGS fails to handle subreg of mem > > > In our ARC port, we found the following situation after expand: > > > > (insn 23 22 24 5 (set (reg:SI 176) > > (subreg:SI (mem/c:DI (plus:SI (reg/f:SI 147 virtual-stack-vars) > > (const_int -268 [0xfffffffffffffef4])) [3 > > tmpoutst.st_size+0 S8 A32]) 4)) t02.c:64 -1 (nil)) > > > > The virtual-stack-vars should be handled by GCC's VREGS step, in > > instantiate_virtual_regs_in_insn(). However, this is not happening as > > the subroutine is not designed to handle subregs of a mem. As a > > consequence, virtual-stack-vars is not eliminated, and the compilation fails > later on. > > To solve this issue, I am proposing the attached patch on vregs, that > > implements handling of such situation by > > instantiate_virtual_regs_in_insn(). > > > > Can you please let me know if this is an acceptable solution for the > > given issue? > > Very likely not, there should be no SUBREGs of MEMs after expand. > > -- > Eric Botcazou