This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] cfg_remove_useless_stmts and invert_truthval
- From: law at redhat dot com
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Thu, 13 Nov 2003 14:10:06 -0700
- Subject: Re: [tree-ssa] cfg_remove_useless_stmts and invert_truthval
- Reply-to: law at redhat dot com
In message <1068753078.26945.62.camel@p4>, Andrew MacLeod writes:
>
>I just checked out a new branch today, applied the expression
>replacement code and tried a build.
>
>Im getting an abort in invert_truthval now building target libiberty
>because I have a condition that looks like:
>
>
>if ((_Bool)iftmp.1182)
>
>Since it's casted, invert_truthval executes this sequence:
> case NOP_EXPR:
> case CONVERT_EXPR:
> case FLOAT_EXPR:
> return build1 (TREE_CODE (arg), type,
> invert_truthvalue (TREE_OPERAND (arg, 0)));
>
>which calls itself on the 'iftmp.1182' VAR_DECL, which is not of type
>boolean, so invert_truthval aborts at the end:
> if (TREE_CODE (TREE_TYPE (arg)) != BOOLEAN_TYPE)
> abort ();
>
>Well of course it isn't boolean, since the cast was removed in the
>previous iteration...
>
>This doesnt seem quite right?... Whats the right thing here? This didnt
>happen a couple of days ago, presumably because of the new
>remove_useless... code.
Presumably this is happening from a call within cfg_remove_useless_stmts?
It certainly calls invert_truthval in a place where it hadn't been
called before.
My question would be why isn't an iftmp variable a boolean to start with!
jeff