diff options
author | Richard Biener <rguenther@suse.de> | 2021-03-09 09:29:29 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-04-26 10:10:06 +0200 |
commit | 577d05fc914338cd7ddc254f3bee4532331f5c13 (patch) | |
tree | 7071eb36cedbf04600f64367a1a73c9485f03ce7 /gcc/tree-ssa-phiopt.c | |
parent | 52a5515ed6619739eb122f05ce26057dd8b06fb6 (diff) | |
download | gcc-577d05fc914338cd7ddc254f3bee4532331f5c13.zip gcc-577d05fc914338cd7ddc254f3bee4532331f5c13.tar.gz gcc-577d05fc914338cd7ddc254f3bee4532331f5c13.tar.bz2 |
tree-optimization/99473 - more cselim
This fixes the pre-condition on cselim to include all references
and decls when they end up as auto-var.
Bootstrapped/tested on x86_64-linux
2021-03-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/99473
* tree-ssa-phiopt.c (cond_store_replacement): Handle all
stores.
* gcc.dg/tree-ssa/pr99473-1.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r-- | gcc/tree-ssa-phiopt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index aa48f44..13e5c497 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -2490,9 +2490,8 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb, locus = gimple_location (assign); lhs = gimple_assign_lhs (assign); rhs = gimple_assign_rhs1 (assign); - if ((TREE_CODE (lhs) != MEM_REF - && TREE_CODE (lhs) != ARRAY_REF - && TREE_CODE (lhs) != COMPONENT_REF) + if ((!REFERENCE_CLASS_P (lhs) + && !DECL_P (lhs)) || !is_gimple_reg_type (TREE_TYPE (lhs))) return false; |