diff options
| author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-04-17 16:49:54 +0000 |
|---|---|---|
| committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-04-17 16:49:54 +0000 |
| commit | 8f3e551a0abced0a47ce6b98af4b98391de676ab (patch) | |
| tree | aaf9abd5466f99930e400bcf277a07d48c765d6a /gcc | |
| parent | 55acdbb28612b8c9e6b8810555e7052b37b4f11e (diff) | |
| download | ppe42-gcc-8f3e551a0abced0a47ce6b98af4b98391de676ab.tar.gz ppe42-gcc-8f3e551a0abced0a47ce6b98af4b98391de676ab.zip | |
* expr.c (expand_assignment): Optimize away no-op moves where the
source and destination are equal and have no side-effects.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113009 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/expr.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index af150ff0005..6595ef506de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-04-17 Roger Sayle <roger@eyesopen.com> + + * expr.c (expand_assignment): Optimize away no-op moves where the + source and destination are equal and have no side-effects. + 2006-04-17 Richard Guenther <rguenther@suse.de> PR target/26826 diff --git a/gcc/expr.c b/gcc/expr.c index b0e958c23b6..f59cc426a17 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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 |

