X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fexpr.c;h=f59cc426a175fb0b1b162f3657ad6c6805659384;hp=b0e958c23b6fa351dfc84e7a5738b2165b32a8a8;hb=8f3e551a0abced0a47ce6b98af4b98391de676ab;hpb=55acdbb28612b8c9e6b8810555e7052b37b4f11e 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