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]

[PATCH] lower-subreg: Fix sparc bootstrap problem


Hello,

the attached patch fixes the problem with my decompose multiword shift
patch which was reported for sparc targets. Although s390 is a
WORDS_BIG_ENDIAN target as well this slipped through my tests since
s390 does not have an SI->DI zeroextend. So the split has already been
done by optab.

Bootstrapped on s390, s390x, i686 and x86_64. No regressions.

Andreas Tobler has tested the patch on sparc and verified that it
fixes bootstrap.

OK for mainline?

Bye,

-Andreas-

2007-08-10  Andreas Krebbel  <krebbel1@de.ibm.com>

	* lower-subreg.c (resolve_shift_zext): Don't adjust
	src_reg_num for wordmode operands.


Index: gcc/lower-subreg.c
===================================================================
*** gcc/lower-subreg.c.orig	2007-08-09 17:20:25.000000000 +0200
--- gcc/lower-subreg.c	2007-08-09 18:59:59.000000000 +0200
*************** resolve_shift_zext (rtx insn)
*** 1043,1053 ****
       endian machines this is register 0.  */
    src_reg_num = GET_CODE (op) == LSHIFTRT ? 1 : 0;
  
!   if (WORDS_BIG_ENDIAN)
      src_reg_num = 1 - src_reg_num;
  
    if (GET_CODE (op) == ZERO_EXTEND)
!     dest_reg_num = src_reg_num;
    else
      dest_reg_num = 1 - src_reg_num;
  
--- 1043,1054 ----
       endian machines this is register 0.  */
    src_reg_num = GET_CODE (op) == LSHIFTRT ? 1 : 0;
  
!   if (WORDS_BIG_ENDIAN
!       && GET_MODE_SIZE (GET_MODE (op_operand)) > UNITS_PER_WORD)
      src_reg_num = 1 - src_reg_num;
  
    if (GET_CODE (op) == ZERO_EXTEND)
!     dest_reg_num = WORDS_BIG_ENDIAN ? 1 : 0;
    else
      dest_reg_num = 1 - src_reg_num;
  


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