target/101788 - avoid decomposing hard-register "loads"
authorRichard Biener <rguenther@suse.de>
Wed, 11 Aug 2021 12:10:52 +0000 (14:10 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 11 Aug 2021 14:24:08 +0000 (16:24 +0200)
This avoids decomposing hard-register accesses that masquerade as
loads.

2021-08-11  Richard Biener  <rguenther@suse.de>

PR target/101877
* tree-ssa-forwprop.c (pass_forwprop::execute): Do not decompose
hard-register accesses.

gcc/tree-ssa-forwprop.c

index bd64b8e..5b30d4c 100644 (file)
@@ -3190,7 +3190,8 @@ pass_forwprop::execute (function *fun)
                       || (fun->curr_properties & PROP_gimple_lvec))
                   && gimple_assign_load_p (stmt)
                   && !gimple_has_volatile_ops (stmt)
-                  && !stmt_can_throw_internal (cfun, stmt))
+                  && !stmt_can_throw_internal (cfun, stmt)
+                  && (!VAR_P (rhs) || !DECL_HARD_REGISTER (rhs)))
            optimize_vector_load (&gsi);
 
          else if (code == COMPLEX_EXPR)