diff options
author | Roger Sayle <roger@eyesopen.com> | 2006-04-17 16:49:54 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2006-04-17 16:49:54 +0000 |
commit | 6cc1d6942627e95cb4afc5de62b1551da1234669 (patch) | |
tree | aaf9abd5466f99930e400bcf277a07d48c765d6a /gcc/expr.c | |
parent | 7304fcb4a7177bc0a988241401f11fa91afaa228 (diff) | |
download | gcc-6cc1d6942627e95cb4afc5de62b1551da1234669.zip gcc-6cc1d6942627e95cb4afc5de62b1551da1234669.tar.gz gcc-6cc1d6942627e95cb4afc5de62b1551da1234669.tar.bz2 |
expr.c (expand_assignment): Optimize away no-op moves where the source and destination are equal and have...
* expr.c (expand_assignment): Optimize away no-op moves where the
source and destination are equal and have no side-effects.
From-SVN: r113009
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3988,13 +3988,16 @@ expand_assignment (tree to, tree from) rtx result; /* Don't crash if the lhs of the assignment was erroneous. */ - if (TREE_CODE (to) == ERROR_MARK) { result = expand_normal (from); return; } + /* Optimize away no-op moves without side-effects. */ + if (operand_equal_p (to, from, 0)) + return; + /* Assignment of a structure component needs special treatment if the structure component's rtx is not simply a MEM. Assignment of an array element at a constant index, and assignment of |