]> gcc.gnu.org Git - gcc.git/commit
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>
Wed, 17 Mar 2021 11:13:43 +0000 (12:13 +0100)
commit371ae12cf3b22795246a5707017f07257b5cbc97
treef66a5422d1bec95731573ab9e8c1fe401b22803e
parente407585a3ae48a25f031450565cf2b657d431cee
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.

(cherry picked from commit 505767905735a3c8f171c140108ee263f9fdcad6)
gcc/fold-const.c
gcc/testsuite/c-c++-common/pr96369.c [new file with mode: 0644]
This page took 0.058958 seconds and 6 git commands to generate.