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 | |
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')
-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 af150ff..6595ef5 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 @@ -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 |