tree-optimization/109139 - fix .DEFERRED_INIT removal
authorRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 08:47:18 +0000 (09:47 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 09:29:27 +0000 (10:29 +0100)
commit0fc541efc340535d212cd685176bd9592905de8a
tree619b7831dc0b4a08f9e65167b956210964c44786
parent45641f3a99281bb0a429649741a29c2aace4c63e
tree-optimization/109139 - fix .DEFERRED_INIT removal

The following make sure to strip MEMs when looking for unused
decls on the LHS of .DEFERRED_INIT.

PR tree-optimization/109139
* tree-ssa-live.cc (remove_unused_locals): Look at the
base address for unused decls on the LHS of .DEFERRED_INIT.

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