This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix PR/14084


> >I have noticed a problem with REG_OFFSET on powerpc64.
> >When variable is stored in register in mode larger than the variable
> >and then variable is used in original mode using subreg
> >the REG_OFFSET after simplification of subreg is wrong.
> 
> I think this patch is more complicated than it needs to be.  What we 
> need to do here is convert a subreg offset into a mem offset.  This is 
> the inverse of the usual big-endian correction that converts a mem 
> offset into a subreg offset.
> 
> subreg_lowpart_offset does the mem->reg offset conversion, assuming that 
> the mem offset is zero.
> 
> Thus, if subreg_lowpart_offset == byte, then it must be the case that 
> REG_OFFSET should be zero.  I see no need for the rest of the code.

IMHO that would not work for struct of 2 SImode elements in DImode register.
We do not want to change REG_OFFSET in this case, that's why there are
conditions regarding the size of mode and decl in my patch.

Josef


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]