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]

Re: Alternate booleans patch


On Wed, Feb 28, 2001 at 12:09:12AM -0800, Richard Henderson wrote:
> On Tue, Feb 27, 2001 at 10:15:48PM -0800, Zack Weinberg wrote:
> > It also provides us with a universal definition of a 'bool' type,
> > which is the C99 _Bool if available.
> 
> Ok for mainline.  Thanks.

Will apply shortly.

> I see Fergus found one mistake (which I missed in reading the patch).
> It appears that that is the only instance of the old variable being
> an integer, and thus the new define being readily substitutable, which
> limits the likelyhood of there being too many others.

I checked again with cscope.  In addition to the mistake Fergus
caught, there were variables named true and false in mcore.c, and yet
another definition of bool in f/intdoc.c.  There's also weird things
going on in fixinc/gnu-regex.c; I'm leaving that file alone because it
was imported verbatim from glibc.  (And it seems to work just fine as
is.)  Additional patch appended.

zw

===================================================================
Index: config/mcore/mcore.c
--- config/mcore/mcore.c	2000/11/17 04:16:55	1.9
+++ config/mcore/mcore.c	2001/03/02 01:35:29
@@ -2634,8 +2634,8 @@ mcore_dependent_simplify_rtx (x, int_op0
     {
       int i;
       rtx cond = XEXP(x, 0);
-      rtx true = XEXP(x, 1);
-      rtx false = XEXP(x, 2);
+      rtx true_rtx = XEXP(x, 1);
+      rtx false_rtx = XEXP(x, 2);
       enum rtx_code true_code = GET_CODE (cond);
 
       /* On the mcore, when doing -mcmov-one, we don't want to simplify:
@@ -2648,12 +2648,12 @@ mcore_dependent_simplify_rtx (x, int_op0
          not typically help.  see combine.c, line 4217.  BRC  */
 
       if (true_code == NE && XEXP (cond, 1) == const0_rtx
-	  && false == const0_rtx && GET_CODE (true) == CONST_INT
+	  && false_rtx == const0_rtx && GET_CODE (true_rtx) == CONST_INT
 	  && ((1 == nonzero_bits (XEXP (cond, 0), mode)
-	       && (i = exact_log2 (INTVAL (true))) >= 0)
+	       && (i = exact_log2 (INTVAL (true_rtx))) >= 0)
 	      || ((num_sign_bit_copies (XEXP (cond, 0), mode)
 	           == GET_MODE_BITSIZE (mode))
-		  && (i = exact_log2 (- INTVAL (true))) >= 0)))
+		  && (i = exact_log2 (- INTVAL (true_rtx))) >= 0)))
 	{
 	  *general_simplify = 0; 
 	  return x;
===================================================================
Index: f/intdoc.c
--- f/intdoc.c	2000/08/24 20:32:41	1.15
+++ f/intdoc.c	2001/03/02 01:35:30
@@ -26,17 +26,6 @@ the Free Software Foundation, 59 Temple 
 #include "system.h"
 #include "assert.h"
 
-typedef enum
-  {
-#if !defined(false) || !defined(true)
-    false = 0, true = 1,
-#endif
-#if !defined(FALSE) || !defined(TRUE)
-    FALSE = 0, TRUE = 1,
-#endif
-    Doggone_Trailing_Comma_Dont_Work = 1
-  } bool;
-
 /* Pull in the intrinsics info, but only the doc parts.  */
 #define FFEINTRIN_DOC 1
 #include "intrin.h"


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