On Thu, Jan 05, 2017 at 04:39:40PM +0100, Marek Polacek wrote: > Coming back to this...
> > Right, after h0 == h1 is missing && operand_equal_p (thenb, elseb, 0) > > or so (the exact last operand needs to be figured out). > > OEP_ONLY_CONST is certainly wrong, we want the same VAR_DECLs to mean the > > same thing. 0 is a tiny bit better, but still it will give up on e.g. pure > > and other calls. OEP_PURE_SAME is tiny bit better than that, but still > > calls with the same arguments to the same function will not be considered > > equal, plus likely operand_equal_p doesn't handle STATEMENT_LIST etc. > > So maybe we need another OEP_* mode for this. > > Yea, if I add "&& operand_equal_p (thenb, elseb, 0)" then this warning doesn't > trigger for certain cases, such as MODIFY_EXPR, RETURN_EXPR, probably > STATEMENT_LIST and others. So I suppose I could introduce a new OEP_ mode for > this (names? OEP_EXTENDED?) and then in operand_equal_p in case > tcc_expression > do > > case MODIFY_EXPR: > if (flags & OEP_EXTENDED) > // compare LHS and RHS of both > > ? Yeah. Not sure what is the best name for that. Maybe Richi has some clever ideas. Jakub