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

[Bug c/11449] [3.4 Regression] ICE in invert_truthvalue called on AND operation


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11449



------- Additional Comments From neroden at gcc dot gnu dot org  2003-07-10 01:53 -------
We know it's hitting this abort in invert_truthvalue, which means to me that
it's being called on the BIT_AND_EXPR.

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

Now TREE_TYPE(arg) should be "int" (since the bitwise & of two ints is an int).
So what's up with this abort?
Perhaps the comment for invert_truthvalue will give a clue:

/* Return a simplified tree node for the truth-negation of ARG.  This
   never alters ARG itself.  We assume that ARG is an operation that
   returns a truth value (0 or 1).  */
Well, that's a false assumption when ARG is a bitwise AND, pretty much always.  
And probably in many other places.  I strongly suspect that invert_truthvalue
is called on a lot of integral types which aren't actually boolean.

So I'm guessing that the comment should be changed to 
(0 or non-zero)
and the abort condition should be changed to allow INTEGER_TYPE.  Probably.  :-)  

If this would break Java or something (Java only allows booleans to be negated
if I remember rightly, but that may not matter at the tree level), then we need
a new TRUTHVALUE_TYPE_P macro which is language dependent.


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