Compiling libsvn_delta/text_delta.c with -O2 -ftree-loop-vectorize
-fvect-cost-model=dynamic also causes failure (ie. those two options are
the specific ones added by -O3 that cause failure).  The problem is this
code:

/* Copy LEN bytes from SOURCE to TARGET.  Unlike memmove() or memcpy(),
 * create repeating patterns if the source and target ranges overlap.
 * Return a pointer to the first byte after the copied target range.  */
static APR_INLINE char *
patterning_copy(char *target, const char *source, apr_size_t len)
{
  const char *end = source + len;

  /* On many machines, we can do "chunky" copies. */

#if SVN_UNALIGNED_ACCESS_IS_OK

  if (end + sizeof(apr_uint32_t) <= target)
    {
      /* Source and target are at least 4 bytes apart, so we can copy in
       * 4-byte chunks.  */
      for (; source + sizeof(apr_uint32_t) <= end;
           source += sizeof(apr_uint32_t),
           target += sizeof(apr_uint32_t))
      *(apr_uint32_t *)(target) = *(apr_uint32_t *)(source);
    }

#endif

  /* fall through to byte-wise copy (either for the below-chunk-size tail
   * or the whole copy) */
  for (; source != end; source++)
    *(target++) = *source;

  return target;
}

Specifically the code inside #if SVN_UNALIGNED_ACCESS_IS_OK.  That loop
can't be done in any chunks bigger than the difference between "target"
and "end", but it seems the loop vectorizer is not careful enough to
handle overlapping target and source in this case.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1353142

Title:
  subversion tests fail on ppc64el when built with -O3

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1353142/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to