]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/94963 - avoid bogus uninit warning with store-motion
authorRichard Biener <rguenther@suse.de>
Wed, 6 May 2020 07:39:45 +0000 (09:39 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 6 May 2020 10:39:24 +0000 (12:39 +0200)
commit371905d12259c180efb9b1f1b5716e969feb60f9
tree5cfdd80887d702d6de60cbeab7cf467c5a2eddf3
parent6208287fcaf01d3f300442c14a2c13815fbb3191
tree-optimization/94963 - avoid bogus uninit warning with store-motion

Eliding the load for store-motion causes an uninitialized variable
flowing into the loop, conditionally initialized and used.  The
uninit warning cannot relate the flag used to guard the initialization
and use with the actual initialization so the following robustifies
the previous approach of marking the conditional store as not to
be warned on by instead initializing the variable on loop entry
from an uninitialized variable we mark as not to be warned for.

2020-05-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/94963
* tree-ssa-loop-im.c (execute_sm_if_changed): Remove
no-warning marking of the conditional store.
(execute_sm): Instead mark the uninitialized state
on loop entry to be not warned about.

* gcc.dg/pr94963.c: New testcase.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr94963.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c
This page took 0.094359 seconds and 6 git commands to generate.