[Bug 1353142] Re: subversion tests fail on ppc64el when built with -O3

Alan Modra amodra.tools at gmail.com
Sat Aug 9 13:18:21 UTC 2014


No, const doesn't make any difference.

On looking again at the source, I've come to the conclusion that this
isn't a vectorizer bug after all.  It is simply a coding error.

A compiler is allowed to assume that  a pointer to a type is aligned suitably for the type.  So in
 *(apr_uint32_t *)target = *(apr_uint32_t *)source;
gcc is allowed to assume that source and target are 4-byte aligned, but they are not..
Modifying the code to use an unaligned 4-byte type here cures the problem.

Quoting from ISO/IEC 9899:1999
6.3.2.3 Pointers
...
7 A pointer to an object or incomplete type may be converted to a pointer to a different
 object or incomplete type. If the resulting pointer is not correctly aligned for the
pointed-to type, the behavior is undefined.

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

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

Status in “gcc-4.9” package in Ubuntu:
  New
Status in “subversion” package in Ubuntu:
  New

Bug description:
  subversion tests fail on ppc64el when built with -O3, seen in

  https://launchpad.net/ubuntu/+source/subversion/1.8.9-2ubuntu1

  building with -O2 lets the tests succeed
  https://launchpad.net/ubuntu/+source/subversion/1.8.9-2ubuntu2

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



More information about the foundations-bugs mailing list