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]
Other format: [Raw text]

Re: [tree-ssa] cfg_remove_useless_stmts and invert_truthval


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


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