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 15:47:23 -0700
- Subject: Re: [tree-ssa] cfg_remove_useless_stmts and invert_truthval
- Reply-to: law at redhat dot com
In message <1068759882.2035.21.camel@p4>, Andrew MacLeod writes:
>> My question would be why isn't an iftmp variable a boolean to start with!
>>
>Well, I dont care about that myself, since this could arbitrarily happen
>anywhere we use a non-boolean in a COND_EXPR. The expression combiner
>would do the exact thing it did above, move the expression and the cast
>into the COND_EXPR.
>
>It looks like GENERIC generates iftmp as ints, and we get GIMPLE temps
>which cast them to booleans. I now move those casts into the COND_EXPR,
>and cfg_remove_useless_stmts_bb craps out here.
>
>Shouldn't invert_truthval() look for the case where it has a cast to a
>boolean, and simply invert the expression at that point instead of
>continuing to strip the cast off and try to invert it?
>
>I tried the following patchlet, and it seems to work fine...Is something
>like this OK?
Seems pretty reasonable to me.
jeff