[Bug c++/58845] [4.8/4.9 Regression] Operator || and && broken for vectors

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Nov 24 15:39:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58845

--- Comment #12 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #9)
> Yeah, exactly.  Still if there is a sequence point at && or ||
> (even if both arms are always executed) then the order of evaluating
> side-effects is important.  IIRC only AND/ORIF have an implicit
> sequence point during gimplification.

We have avoided generating TRUTH_*_EXPR for vectors (at your request IIRC), so
I don't think we should produce some in the front-end now, even if temporarily,
as they would leak into fold-const.c. It seems easiest to save_expr the lhs and
build a compound_expr(lhs,*) to enforce the evaluation of the lhs first, I
think that gets us a sequence point as well.



More information about the Gcc-bugs mailing list