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]

[gcc-in-cxx] Fix fold-const.c for C++


I committed this patch to the gcc-in-cxx branch to fix compiling
fold-const.c with C++.  Just more enum issues.

Ian


2009-02-03  Ian Lance Taylor  <iant@google.com>

	* fold-const.c (fold_undefer_overflow_warnings): Add cast to enum
	type.
	(combine_comparisons): Change compcode to int.  Add cast.


Index: fold-const.c
===================================================================
--- fold-const.c	(revision 143890)
+++ fold-const.c	(working copy)
@@ -964,7 +964,7 @@ fold_undefer_overflow_warnings (bool iss
       if (fold_deferred_overflow_warning != NULL
 	  && code != 0
 	  && code < (int) fold_deferred_overflow_code)
-	fold_deferred_overflow_code = code;
+	fold_deferred_overflow_code = (enum warn_strict_overflow_code) code;
       return;
     }
 
@@ -2914,7 +2914,7 @@ combine_comparisons (enum tree_code code
   bool honor_nans = HONOR_NANS (TYPE_MODE (TREE_TYPE (ll_arg)));
   enum comparison_code lcompcode = comparison_to_compcode (lcode);
   enum comparison_code rcompcode = comparison_to_compcode (rcode);
-  enum comparison_code compcode;
+  int compcode;
 
   switch (code)
     {
@@ -2980,8 +2980,11 @@ combine_comparisons (enum tree_code code
   else if (compcode == COMPCODE_FALSE)
     return constant_boolean_node (false, truth_type);
   else
-    return fold_build2 (compcode_to_comparison (compcode),
-			truth_type, ll_arg, lr_arg);
+    {
+      enum comparison_code cc = (enum comparison_code) compcode;
+      return fold_build2 (compcode_to_comparison (cc),
+			  truth_type, ll_arg, lr_arg);
+    }
 }
 
 /* Return nonzero if two operands (typically of the same tree node)

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