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
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