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: [RFC] Tightening up the type system


Hi Diego,

Just one very minor suggestion;

On Thu, 30 Sep 2004, Diego Novillo wrote:
> 	  if (TREE_CODE (t) == EQ_EXPR)
> -	    return boolean_false_node;
> +	    return fold_convert (TREE_TYPE (t), boolean_false_node);
> 	  else
> -	    return boolean_true_node;
> +	    return fold_convert (TREE_TYPE (t), boolean_true_node);

This is probably more efficiently done as

	return constant_boolean_node (TREE_CODE (t) != EQ_EXPR,
				      TREE_TYPE (t));


Before Nathan's integer_cst sharing patch, constant_boolean_node
used to avoid creating duplicates of boolean_true_node,
boolean_false_node, integer_one_node and integer_zero_node.
Nowadays, it's less of a win but probably still preferable to
fold_convert.

Roger
--


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