This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/15084: -O/-O2 generate wrong code on structure modification
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, gdr at integrable-solutions dot net
- Date: Tue, 27 Apr 2004 16:07:31 -0700
- Subject: Re: PATCH: PR target/15084: -O/-O2 generate wrong code on structure modification
- References: <20040427193457.GA9028@lucon.org> <20040427224400.GN1248@kam.mff.cuni.cz>
On Wed, Apr 28, 2004 at 12:44:00AM +0200, Jan Hubicka wrote:
> > The problem is movsi_insv_1_rex64 is invalid in 64bit since the 32bit
> > move will be zero extended to 64bit for registers. insv for 64bit
> > should be in DImode. The encloded patch seems to fix the problem
> > for gcc 3.2 and gcc 3.4. I expect it should work for 3.3 and mainline.
> >
> >
> > H.J.
>
> > 2004-04-27 H.J. Lu <hongjiu.lu@intel.com>
> >
> > * config/i386/i386.md (*movsi_insv_1_rex64): Changed to DImode
> > and renamed to movdi_insv_1_rex64.
> > (insv): Support SImode for 32bit and DImode for 64bit.
>
> This patch looks is fine for mainline and for 3.4.1 week or so later.
> Perhaps it would make sense to duplicate the movsi_insv_1_rex64 pattern
> to SI and DImode version so combine will match if it will convert the
> first one. I am not sure if it makes some difference since combine has
> some logic to always use word mode. It would be nice to look into it.
>
I'd like to see mainline, 3.3 and 3.4 get fixed soon one way or the
other. The current compiler just siliently generates the wrong code.
Let me know if I should check in my patch.
H.J.