tree-optimization/112909 - uninit diagnostic with abnormal copy
commit5e25baa7e577f9b73f746005efb5ccd4e000e51e
authorRichard Biener <rguenther@suse.de>
Fri, 8 Dec 2023 08:14:43 +0000 (8 09:14 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 8 Dec 2023 10:31:26 +0000 (8 11:31 +0100)
tree17cfd8315bdc9c154764d5b8c63e4dbc109383e8
parent3b93ce50af3d02455c17ee5723137b8865ca4a39
tree-optimization/112909 - uninit diagnostic with abnormal copy

The following avoids spurious uninit diagnostics for SSA name
copies which mostly appear when the source is marked as abnormal
which prevents copy propagation.

To prevent regressions I remove the bail out for anonymous SSA
names in the PHI arg place from warn_uninitialized_phi leaving
that to warn_uninit where I handle SSA copies from a SSA name
which isn't anonymous.  In theory this might cause more
valid and false positive diagnostics to pop up.

PR tree-optimization/112909
* tree-ssa-uninit.cc (find_uninit_use): Look through a
single level of SSA name copies with single use.

* gcc.dg/uninit-pr112909.c: New testcase.
gcc/testsuite/gcc.dg/uninit-pr112909.c [new file with mode: 0644]
gcc/tree-ssa-uninit.cc