This is the mail archive of the 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] fix checking failure for gcc.dg/20020531-1.c

This fixes a failure shown by enable checking on i686-linux. Looks like
it was just a missed condition from Zdenek breaking out the code into
separate functions.

Admittedly I didn't check if it was a regression, but I'm assuming it is
since it had to work before the patch to break out the code.

Fixes the testcase, and looks pretty obvious. OK pending bootstrap and
test success? 


2004-11-30  Eric Christopher  <>

	* fold-const.c (fold_widened_comparison): Make sure that we're
	passing an INTEGER_TYPE to int_fits_type_p.
	(fold): Clean up comment.

Index: fold-const.c
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.480
diff -u -p -w -r1.480 fold-const.c
--- fold-const.c	27 Nov 2004 20:54:33 -0000	1.480
+++ fold-const.c	30 Nov 2004 08:08:57 -0000
@@ -6000,6 +6000,7 @@ fold_widened_comparison (enum tree_code 
       && (TREE_TYPE (arg1_unw) == shorter_type
 	  || (TREE_CODE (arg1_unw) == INTEGER_CST
+	      && TREE_CODE (shorter_type) == INTEGER_TYPE
 	      && int_fits_type_p (arg1_unw, shorter_type))))
     return fold (build (code, type, arg0_unw,
 			fold_convert (shorter_type, arg1_unw)));
@@ -8428,9 +8429,8 @@ fold (tree expr)
       /* Comparisons with the highest or lowest possible integer of
 	 the specified size will have known values.
-	 This is quite similar to fold_relational_hi_lo; however, my
-	 attempts to share the code have been nothing but trouble.
-	 I give up for now.  */
+	 This is quite similar to fold_relational_hi_lo, however,
+	 attempts to share the code have been nothing but trouble.  */
 	int width = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg1)));

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