On Wed, Sep 28, 2016 at 5:51 PM, Aaron Sawdey <acsaw...@linux.vnet.ibm.com> wrote: > This patch that Bernd put in PR77718 seems to be fine. Bootstrap and > regtest done on powerpc64le, no new failures. Ok for trunk?
Ok. Richard. > 2016-09-28 Bernd Schmidt <bschm...@redhat.com> > > * builtins.c (expand_builtin_memcmp): don't swap args unless > result is only being compared with zero. > > Index: builtins.c > =================================================================== > --- builtins.c (revision 240511) > +++ builtins.c (working copy) > @@ -3707,11 +3707,13 @@ expand_builtin_memcmp (tree exp, rtx tar > > by_pieces_constfn constfn = NULL; > > - const char *src_str = c_getstr (arg1); > - if (src_str == NULL) > - src_str = c_getstr (arg2); > - else > - std::swap (arg1_rtx, arg2_rtx); > + const char *src_str = c_getstr (arg2); > + if (result_eq && src_str == NULL) > + { > + src_str = c_getstr (arg1); > + if (src_str != NULL) > + std::swap (arg1_rtx, arg2_rtx); > + } > > /* If SRC is a string constant and block move would be done > by pieces, we can avoid loading the string from memory > > -- > Aaron Sawdey, Ph.D. acsaw...@linux.vnet.ibm.com > 050-2/C113 (507) 253-7520 home: 507/263-0782 > IBM Linux Technology Center - PPC Toolchain >