This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Tightening up the type system
- From: Roger Sayle <roger at eyesopen dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 30 Sep 2004 19:58:06 -0600 (MDT)
- Subject: 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
--