This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
m68k zero_extend fix
- To: Roman Zippel <zippel at linux-m68k dot org>, gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Subject: m68k zero_extend fix
- From: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Date: Fri, 20 Jul 2001 21:46:19 +0200
- References: <3B58608D.940DC9A4@linux-m68k.org> <20010720190052.T22463@atrey.karlin.mff.cuni.cz> <3B587317.5A29887E@linux-m68k.org> <20010720201457.B4277@atrey.karlin.mff.cuni.cz> <3B587B48.BCF80225@linux-m68k.org>
> Hi,
>
> > Whats about this patch?
>
> Yes, that helped. :-)
> Thanks.
Hi,
the subreg combination code in m68k zero_extend expanders is wrong.
Honza
Fri Jul 20 21:44:19 CEST 2001 Roman Zippel <zippel@linux-m68k.org>
Jan Hubicka <jh@suse.cz>
* m68k.md (zero_extend?i?i2 expander): Use gen_lowpart instead
of doing the change by hand.
Index: m68k.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/m68k/m68k.md,v
retrieving revision 1.41
diff -c -3 -p -r1.41 m68k.md
*** m68k.md 2001/07/03 19:44:12 1.41
--- m68k.md 2001/07/20 18:14:19
***************
*** 1551,1561 ****
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
! if (GET_CODE (operands[0]) == SUBREG)
! operands[2] = gen_rtx_SUBREG (HImode, SUBREG_REG (operands[0]),
! SUBREG_BYTE (operands[0]));
! else
! operands[2] = gen_rtx_SUBREG (HImode, operands[0], 0);
}")
(define_expand "zero_extendqihi2"
--- 1551,1557 ----
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
! operands[2] = gen_lowpart (HImode, operands[0]);
}")
(define_expand "zero_extendqihi2"
***************
*** 1567,1577 ****
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
! if (GET_CODE (operands[0]) == SUBREG)
! operands[2] = gen_rtx_SUBREG (QImode, SUBREG_REG (operands[0]),
! SUBREG_BYTE (operands[0]));
! else
! operands[2] = gen_rtx_SUBREG (QImode, operands[0], 0);
}")
(define_expand "zero_extendqisi2"
--- 1563,1569 ----
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
! operands[2] = gen_lowpart (QImode, operands[0]);
}")
(define_expand "zero_extendqisi2"
***************
*** 1583,1593 ****
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
! if (GET_CODE (operands[0]) == SUBREG)
! operands[2] = gen_rtx_SUBREG (QImode, SUBREG_REG (operands[0]),
! SUBREG_BYTE (operands[0]));
! else
! operands[2] = gen_rtx_SUBREG (QImode, operands[0], 0);
}")
;; Patterns to recognize zero-extend insns produced by the combiner.
--- 1575,1581 ----
"
{
operands[1] = make_safe_from (operands[1], operands[0]);
! operands[2] = gen_lowpart (QImode, operands[0]);
}")
;; Patterns to recognize zero-extend insns produced by the combiner.