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]

Re: [patch] Fix pr23046


On Sat, Aug 06, 2005 at 01:51:23AM -0400, James A. Morrison wrote:
> 	PR middle-end/23046
> 	* fold-const.c (fold_binary): Return 0 for X > TYPE_MAX_VALUE or
> 	X < TYPE_MIN_VALUE.

We've just discussed that it'll break Ada.

Have you tried the patch I suggested to fix this bug?


r~



Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.615
diff -u -p -d -r1.615 fold-const.c
--- fold-const.c	4 Aug 2005 18:55:14 -0000	1.615
+++ fold-const.c	9 Aug 2005 18:02:40 -0000
@@ -9172,7 +9172,7 @@ fold_binary (enum tree_code code, tree t
       /* Comparisons with the highest or lowest possible integer of
 	 the specified size will have known values.  */
       {
-	int width = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg1)));
+	int width = TYPE_PRECISION (TREE_TYPE (arg1));
 
 	if (TREE_CODE (arg1) == INTEGER_CST
 	    && ! TREE_CONSTANT_OVERFLOW (arg1)


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