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]

m68k zero_extend fix


> 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.


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