[FFmpeg-devel] fate-rv20-1239 failure on power8, aliasing bug
cand at gmx.com
Sun Nov 25 17:17:58 EET 2018
The lone power8 fate failing test seems like an aliasing issue.
I've isolated it into the attached standalone test case. Compiling it
gcc -std=c11 -maltivec -mabi=altivec -mvsx -O3 -fno-tree-vectorize
-o test test.c
reproduces on gcc 8.2.0, dropping the optimization level fixes it. This
was one of the "adding a printf made it work" things too.
-Wstrict-aliasing=1 complains about the "register int *idataptr =
(int*)dataptr;" cast. If I put "typedef int __attribute__((may_alias))
int_alias;" at the top and change the cast and type to int_alias, the
results become correct.
This code would probably crash on systems where unaligned access is
prohibited, I think the incoming block is just 16-bit aligned. How do
you prefer to fix alignment/aliasing issues?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7935 bytes
Desc: not available
More information about the ffmpeg-devel