On Tue, Jun 26, 2018 at 11:12:40PM +0200, Thomas Koenig wrote: > Hi Janus, > > with your patch, we would only warn about > > var .and. func() > > and not about > > func() .and. var. > > AFAIK, TRUTH_AND_EXPR does not guarantee that func() will > always be exectued, or if it does, I have not seen the > documentation; it just happens to match what we currently > see (which may be due to missed optimizatins in the back end, > or the lack of test cases exposing this).
If you are talking about what the middle-end does, TRUTH_AND_EXPR always evaluates side-effects in both operands, while for TRUTH_ANDIF_EXPR it evaluates the second operand only if the first operand is not false. Jakub