aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-expr.c
diff options
context:
space:
mode:
authorHao Liu <hliu@os.amperecomputing.com>2020-06-04 16:28:37 +0800
committerHao Liu <hliu@os.amperecomputing.com>2020-06-04 17:04:09 +0800
commit54ecfb182bc32140722022c1d9818dee4bdc0e45 (patch)
treed3850c29fff3700aba2e76d39f7cde8269047e9f /gcc/gimple-expr.c
parent9b4e77e807e0099c3cfbf9c5b0c9e4154b9cb7a0 (diff)
downloadgcc-54ecfb182bc32140722022c1d9818dee4bdc0e45.zip
gcc-54ecfb182bc32140722022c1d9818dee4bdc0e45.tar.gz
gcc-54ecfb182bc32140722022c1d9818dee4bdc0e45.tar.bz2
cselim: Extend to check non-trapping for more references [PR89430]
If there is a dominating store, a store to the same reference can not be trapped. But previously, it only supports such check on MEM_REFs. So this patch extends it to support ARRAY_REFs and COMPONENT_REFs. This patch also supports a special case: if there is a dominating load of local variable without address escape, a store is not trapped, as local stack is always writable. Other loads are ignored for simplicity, as they don't help to check if a store can be trapped (the memory may be read-only). gcc/ChangeLog: PR tree-optimization/89430 * tree-ssa-phiopt.c (struct name_to_bb): Rename to ref_to_bb; add a new field exp; remove ssa_name_ver, store, offset fields. (struct ssa_names_hasher): Rename to refs_hasher; update functions. (class nontrapping_dom_walker): Rename m_seen_ssa_names to m_seen_refs. (nontrapping_dom_walker::add_or_mark_expr): Extend to support ARRAY_REFs and COMPONENT_REFs. gcc/testsuite/ChangeLog: PR tree-optimization/89430 * gcc.dg/tree-ssa/pr89430-1.c: Remove xfail. * gcc.dg/tree-ssa/pr89430-2.c: Remove xfail. * gcc.dg/tree-ssa/pr89430-5.c: Remove xfail. * gcc.dg/tree-ssa/pr89430-6.c: Remove xfail. * gcc.dg/tree-ssa/pr89430-7-comp-ref.c: New test. * gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c: New test. * gcc.dg/tree-ssa/ssa-pre-17.c: Add -fno-tree-cselim.
Diffstat (limited to 'gcc/gimple-expr.c')
0 files changed, 0 insertions, 0 deletions