Hi,
On Tue, 11 Oct 2011, Kai Tietz wrote:
> > Better make it a separate function the first tests your new
> > conditions, and then calls simple_operand_p.
>
> Well, either I make it a new function and call it instead of
> simple_operand_p,
That's what I meant, yes.
> >> @@ -5149,13 +5176,6 @@ fold_truthop (location_t loc, enum tree_
> >> build2 (BIT_IOR_EXPR, TREE_TYPE (ll_arg),
> >> ll_arg, rl_arg),
> >> build_int_cst (TREE_TYPE (ll_arg), 0));
> >> -
> >> - if (LOGICAL_OP_NON_SHORT_CIRCUIT)
> >> - {
> >> - if (code != orig_code || lhs != orig_lhs || rhs != orig_rhs)
> >> - return build2_loc (loc, code, truth_type, lhs, rhs);
> >> - return NULL_TREE;
> >> - }
> >
> > Why do you remove this hunk? Shouldn't you instead move the hunk you
> > added to fold_truth_andor() here. I realize this needs some TLC to
> > fold_truth_andor_1, because right now it early-outs for non-comparisons,
> > but it seems the better place. I.e. somehow move the below code into the
> > above branch, with the associated diddling on fold_truth_andor_1 that it
> > gets called.
>
> This hunk is removed, as it is vain to do here.
There is a fallthrough now, that wasn't there before. I don't know if
it's harmless, I just wanted to mention it.
> Btw richi asked for it, and I agree that new TRUTH-AND/OR packing is
> better done at a single place in fold_truth_andor only.
As fold_truthop is called twice by fold_truth_andor, the latter might
indeed be the better place.
Ciao,
Michael.