Commit d22b7e14 by Andrew Pinski Committed by Andrew Pinski

fold-const.c (fold): Make sure the type is of BOOLEAN_TYPE.

2004-05-30  Andrew Pinski  <pinskia@physics.uc.edu>

        * fold-const.c (fold) [case TRUTH_NOT_EXPR]: Make sure the type is
        of BOOLEAN_TYPE.

From-SVN: r82456
parent a4ddde0d
2004-05-30 Andrew Pinski <pinskia@physics.uc.edu>
* fold-const.c (fold) [case TRUTH_NOT_EXPR]: Make sure the type is
of BOOLEAN_TYPE.
2004-05-30 Kazu Hirata <kazu@cs.umass.edu>
* c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c,
......
......@@ -7215,6 +7215,10 @@ fold (tree expr)
goto associate;
case TRUTH_NOT_EXPR:
/* The argument to invert_truthvalue must have Boolean type. */
if (TREE_CODE (TREE_TYPE (arg0)) != BOOLEAN_TYPE)
arg0 = fold_convert (boolean_type_node, arg0);
/* Note that the operand of this must be an int
and its values must be 0 or 1.
("true" is a fixed value perhaps depending on the language,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment