This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Less work in invert_truthvalue
Richard Henderson <rth@redhat.com> writes:
> On Tue, Feb 15, 2005 at 04:35:34PM -0500, James A. Morrison wrote:
> > - return fold_convert (type,
> > - build_int_cst (NULL_TREE, integer_zerop (arg)));
> > + return build_int_cst (type, integer_zerop (arg));
>
> Rather, constant_boolean_node.
>
>
> r~
>
How about the attached then. Bootstrapped and regtested on powerpc-linux,
all languages, except ada and java. Ok for mainline?
--
Thanks,
Jim
http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim
2005-02-16 James A. Morrison <phython@gcc.gnu.org>
* fold-const.c (invert_truthvalue): <INTEGER_CST>: Call
constant_boolean_node.
Index: fold-const.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.512
diff -u -p -r1.512 fold-const.c
--- fold-const.c 15 Feb 2005 21:58:10 -0000 1.512
+++ fold-const.c 16 Feb 2005 05:08:20 -0000
@@ -2936,8 +2936,7 @@ invert_truthvalue (tree arg)
switch (code)
{
case INTEGER_CST:
- return fold_convert (type,
- build_int_cst (NULL_TREE, integer_zerop (arg)));
+ return constant_boolean_node (integer_zerop (arg), type);
case TRUTH_AND_EXPR:
return build2 (TRUTH_OR_EXPR, type,