diff options
author | Mark Shinwell <shinwell@codesourcery.com> | 2007-01-08 08:33:42 +0000 |
---|---|---|
committer | Mark Shinwell <shinwell@gcc.gnu.org> | 2007-01-08 08:33:42 +0000 |
commit | 46e3b90f7e326c672c4ecddf5287f603a89d03ef (patch) | |
tree | 86d028c760c73cbf43467080ea39ca9e8bbad562 /gcc/tree-ssa-ter.c | |
parent | 99fc25020d47424e0c0b0da370e2e18540b96b73 (diff) | |
download | gcc-46e3b90f7e326c672c4ecddf5287f603a89d03ef.zip gcc-46e3b90f7e326c672c4ecddf5287f603a89d03ef.tar.gz gcc-46e3b90f7e326c672c4ecddf5287f603a89d03ef.tar.bz2 |
re PR tree-optimization/29877 (out of SSA (TER) extends variable life of variable beyond original declared)
PR tree-optimization/29877
gcc/
* tree-ssa-ter.c (is_replaceable_p): Deem assignments with
a register variable on the RHS to not be replaceable.
gcc/testsuite/
* gcc.dg/pr16194.c: Skip test entirely if we don't know the
name of a hard register for the target concerned. Adjust dg-error
directives to cope with new behaviour of TER.
From-SVN: r120571
Diffstat (limited to 'gcc/tree-ssa-ter.c')
-rw-r--r-- | gcc/tree-ssa-ter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c index ca67f91..c6b7ab3 100644 --- a/gcc/tree-ssa-ter.c +++ b/gcc/tree-ssa-ter.c @@ -393,6 +393,12 @@ is_replaceable_p (tree stmt) && FLOAT_TYPE_P (TREE_TYPE (GENERIC_TREE_OPERAND (stmt, 1)))) return false; + /* An assignment with a register variable on the RHS is not + replaceable. */ + if (TREE_CODE (GENERIC_TREE_OPERAND (stmt, 1)) == VAR_DECL + && DECL_HARD_REGISTER (GENERIC_TREE_OPERAND (stmt, 1))) + return false; + /* Calls to functions with side-effects cannot be replaced. */ if ((call_expr = get_call_expr_in (stmt)) != NULL_TREE) { |