This is the mail archive of the gcc@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]

TRUTH_*_EXPR and BOOLEAN_TYPE


Hi,

The documentation in tree.def for TRUTH_*_EXPR says

| /* Combination of boolean values OR OF INTEGERS considered only
|    as zero or nonzero. 

(my emphasis).  But when I try to apply a TRUTH_NOT_EXPR to
an integer variable, I get an abort in invert_truthvalue(),
called from fold().  The abort is apparently complaining that
the argument's type is not a BOOLEAN_TYPE:

  if (TREE_CODE (TREE_TYPE (arg)) != BOOLEAN_TYPE)
    abort ();

So, is the argument of a TRUTH_NOT_EXPR allowed to have integer type,
or must it only have BOOLEAN_TYPE? 
If the latter, is this a documentation bug in tree.def?

P.S. Here's a stack trace.

#0  fancy_abort (file=0x87e17af "fold-const.c", line=2808, function=0x87e19be "invert_truthvalue")
    at diagnostic.c:1676
#1  0x806acbd in invert_truthvalue (arg=0x4020b780) at fold-const.c:2808
#2  0x8076966 in fold (expr=0x4020eba0) at fold-const.c:5948
...

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

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