https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96369
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:d3a0ef7a523fb4cdeabfbb9fab56bfcf8d21ffd5 commit r10-8745-gd3a0ef7a523fb4cdeabfbb9fab56bfcf8d21ffd5 Author: Richard Biener <rguent...@suse.de> Date: Fri Jul 31 08:41:56 2020 +0200 middle-end/96369 - fix missed short-circuiting during range folding This makes the special case of constant evaluated LHS for a short-circuiting or/and explicit rather than doing range merging and eventually exposing a side-effect that shouldn't be evaluated. 2020-07-31 Richard Biener <rguent...@suse.de> PR middle-end/96369 * fold-const.c (fold_range_test): Special-case constant LHS for short-circuiting operations. * c-c++-common/pr96369.c: New testcase. (cherry picked from commit 10231958fcfb13bc4847729eba21470c101b4a88)