FASTDIV macro incorrect for constant propogation
|Reported by:||yang||Owned by:||michael|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Summary of the bug:
In file libavutil/x86/intmath.h, around line 30
In above line, "g" need be replaced by "rm".
Otherwise, if "ff_inverse[b]" is a constant and propogate to "mull" instruction by compiler optimization, the "mull" instruction will become a invalid instruction and the compilation will fail.
How to reproduce:
in folder libavutil/x86 folder, write a simple test case as following:
int x = 8;
int r = FASTDIV(x,0);
compile: gcc test.c -O2
test.c: Assembler messages:
test.c:7: Error: operand type mismatch for "mul"
The operand to the mul instruction can be either register or memory, not an immediate.
This bug will cause Intel C++ compiler compilation failed when IPO optimization is enabled.
Change History (5)
comment:1 follow-up: ↓ 2 Changed 4 years ago by cehoyos
- Keywords FFMPEG mul type mismatch removed
- Version changed from unspecified to git-master