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 to eliminate alpha.c warnings


Cross-compiling cc1 from sparc-sun-solaris2.7 to almost any alpha
target (e.g. alpha-unknown-linux-gnu) yields:

 > config/alpha/alpha.c:3631: warning: integer constant larger than the
 > 	maximum value of an unsigned long int
 > config/alpha/alpha.c:3678: warning: integer constant larger than the
 > 	maximum value of an unsigned long int
 > config/alpha/alpha.c:3810: warning: integer constant larger than the
 > 	maximum value of an unsigned long int

To alpha-unknown-interix, I additionally get:

 > config/alpha/alpha.c:5388: warning: left shift count >= width of type


(I figure the LLs for 64-bit constants are okay since they are guarded
by HOST_BITS_PER_WIDE_INT != 32.)

Ok to install?

		--Kaveh


2001-12-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* alpha.c (alpha_expand_unaligned_store): Use `LL' on 64-bit
	constants.
	(alpha_expand_unaligned_store_words): Likewise.
	(function_arg): Cast value to HOST_WIDE_INT before shifting.

diff -rup orig/egcc-CVS20011201/gcc/config/alpha/alpha.c egcc-CVS20011201/gcc/config/alpha/alpha.c
--- orig/egcc-CVS20011201/gcc/config/alpha/alpha.c	Sun Nov 18 12:45:04 2001
+++ egcc-CVS20011201/gcc/config/alpha/alpha.c	Sun Dec  2 15:02:11 2001
@@ -3628,7 +3628,7 @@ alpha_expand_unaligned_store (dst, src, 
 #if HOST_BITS_PER_WIDE_INT == 32
 	    rtx msk = immed_double_const (0xffffffff, 0xffffffff, DImode);
 #else
-	    rtx msk = immed_double_const (0xffffffffffffffff, 0, DImode);
+	    rtx msk = immed_double_const (0xffffffffffffffffLL, 0, DImode);
 #endif
 	    emit_insn (gen_mskxl_be (dsth, dsth, msk, addr));
 	  }
@@ -3675,7 +3675,7 @@ alpha_expand_unaligned_store (dst, src, 
 #if HOST_BITS_PER_WIDE_INT == 32
 	    rtx msk = immed_double_const (0xffffffff, 0xffffffff, DImode);
 #else
-	    rtx msk = immed_double_const (0xffffffffffffffff, 0, DImode);
+	    rtx msk = immed_double_const (0xffffffffffffffffLL, 0, DImode);
 #endif
 	    emit_insn (gen_mskxl_le (dstl, dstl, msk, addr));
 	  }
@@ -3807,7 +3807,7 @@ alpha_expand_unaligned_store_words (data
 #if HOST_BITS_PER_WIDE_INT == 32
   rtx const im1 = immed_double_const (0xffffffff, 0xffffffff, DImode);
 #else
-  rtx const im1 = immed_double_const (0xffffffffffffffff, 0, DImode);
+  rtx const im1 = immed_double_const (0xffffffffffffffffLL, 0, DImode);
 #endif
   rtx ins_tmps[MAX_MOVE_WORDS];
   rtx st_tmp_1, st_tmp_2, dreg;
@@ -5385,7 +5385,8 @@ function_arg (cum, mode, type, named)
 #if HOST_BITS_PER_WIDE_INT == 32
 	  hi = (cum.num_args << 20) | cum.num_arg_words;
 #else
-	  lo = lo | (cum.num_args << 52) | (cum.num_arg_words << 32);
+	  lo = lo | ((HOST_WIDE_INT) cum.num_args << 52)
+	    | ((HOST_WIDE_INT) cum.num_arg_words << 32);
 	  hi = 0;
 #endif
 	  ciw = immed_double_const (lo, hi, DImode);


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