tree-optimization/105109 - bogus uninit diagnostic with _Complex
authorRichard Biener <rguenther@suse.de>
Thu, 31 Mar 2022 07:21:27 +0000 (09:21 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 31 Mar 2022 08:35:41 +0000 (10:35 +0200)
commit97ad0b831386e56ecb125a25fff00b2cb0b1a2b9
treefef1b241bef258354eec757bfbedcb8389ce94b9
parentbf4832d6fa817f66009f100a9cd68953062add7d
tree-optimization/105109 - bogus uninit diagnostic with _Complex

When update_address_taken rewrites a _Complex into SSA it changes
stores to real/imaginary parts to loads of the other component and
a COMPLEX_EXPR.  That matches what gimplification does but it misses
suppression of diagnostics for the load of the other component.
The following patch adds that, syncing up gimplification and
update_address_taken behavior.

2022-03-31  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105109
* tree-ssa.cc (execute_update_addresses_taken): Suppress
diagnostics on the load of the other complex component.

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