middle-end/96369 - fix missed short-circuiting during range folding
authorRichard Biener <rguenther@suse.de>
Fri, 31 Jul 2020 06:41:56 +0000 (08:41 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 31 Jul 2020 10:05:26 +0000 (12:05 +0200)
commit10231958fcfb13bc4847729eba21470c101b4a88
tree638d05239bb3e8ccb0f2bee286029e9c58b31315
parentbc2b1a232b1825b421a1aaa21a0865b2d1e4e08c
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  <rguenther@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.
gcc/fold-const.c
gcc/testsuite/c-c++-common/pr96369.c [new file with mode: 0644]