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] Fix predict.c (was Re: Convert TREE_CODE_CLASS from letters to enumeration constants)


On Fri, Sep 17, 2004 at 12:13:57PM -0700, Zack Weinberg wrote:
> 
> This patch converts all TREE_CODE_CLASS values from character
> constants to enumeration constants.  This is good for an approximately
> 1.5% speedup building Qt at -g -O0 -- mostly, I believe, because
> IS_EXPR_CODE_CLASS is now two numeric comparisons instead of a call to
> strchr().

Nice.

Seems you missed expr_expected_value in predict.c though.
Commited as obvious.

2004-09-20  Jakub Jelinek  <jakub@redhat.com>

	* predict.c (expr_expected_value): Use *_CLASS_P macros.

--- gcc/predict.c.jj	2004-09-20 17:35:57.000000000 +0200
+++ gcc/predict.c	2004-09-20 18:50:22.191173276 +0200
@@ -944,8 +944,7 @@ expr_expected_value (tree expr, bitmap v
 	  return TREE_VALUE (TREE_CHAIN (TREE_OPERAND (expr, 1)));
 	}
     }
-  if (TREE_CODE_CLASS (TREE_CODE (expr)) == '2'
-      || TREE_CODE_CLASS (TREE_CODE (expr)) == '<')
+  if (BINARY_CLASS_P (expr) || COMPARISON_CLASS_P (expr))
     {
       tree op0, op1, res;
       op0 = expr_expected_value (TREE_OPERAND (expr, 0), visited);
@@ -959,7 +958,7 @@ expr_expected_value (tree expr, bitmap v
 	return res;
       return NULL;
     }
-  if (TREE_CODE_CLASS (TREE_CODE (expr)) == '1')
+  if (UNARY_CLASS_P (expr))
     {
       tree op0, res;
       op0 = expr_expected_value (TREE_OPERAND (expr, 0), visited);


	Jakub


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