aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadbackward.c
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2021-10-16 04:14:57 +0000
committerAndrew Pinski <apinski@marvell.com>2021-10-21 08:18:58 +0000
commit113860301f46d14a255bd947d18d36f917527230 (patch)
treed146b49eef3628ed6b72086820c2bb089ea06421 /gcc/tree-ssa-threadbackward.c
parent36ec4a3c927bd2cc212a7f331ad842cd90eb5283 (diff)
downloadgcc-113860301f46d14a255bd947d18d36f917527230.zip
gcc-113860301f46d14a255bd947d18d36f917527230.tar.gz
gcc-113860301f46d14a255bd947d18d36f917527230.tar.bz2
Improve maybe_remove_writeonly_store to do a simple DCE for defining statement
Instead of putting a full blow DCE after execute_fixup_cfg, it makes sense to try to remove the defining statement for the store that is being removed. Using simple_dce_from_worklist makes this easier, just mark the ssa_name on the rhs side of the store (if it was one) in a bitmap and then call simple_dce_from_worklist at the end. gcc.dg/pr36902.c needed to be changed such that the static array was no longer a static array but a global array. This is because this new dce will remove the load as it is dead. I also filed PR 102864 for the warning on dead loads. gcc/ChangeLog: * tree-cfg.c (maybe_remove_writeonly_store): Add dce_ssa_names argument. Mark the ssa-name of the rhs as one to be removed. (execute_fixup_cfg): Update call to maybe_remove_writeonly_store. Call simple_dce_from_worklist at the end to a simple dce. gcc/testsuite/ChangeLog: * gcc.dg/pr36902.c: Move buf to be a non-static variable.
Diffstat (limited to 'gcc/tree-ssa-threadbackward.c')
0 files changed, 0 insertions, 0 deletions