Opened 12 years ago
Closed 12 years ago
#1466 closed defect (fixed)
FASTDIV macro incorrect for constant propogation
Reported by: | yang | Owned by: | Michael Niedermayer |
---|---|---|---|
Priority: | normal | Component: | avutil |
Version: | git-master | Keywords: | FASTDIV |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
In file libavutil/x86/intmath.h, around line 30
"g"(ff_inverse[b])\
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:
#include "intmath.h"
int main()
{
int ff_inverse[2]={1,2};
int x = 8;
int r = FASTDIV(x,0);
return r;
}
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.
Attachments (1)
Change History (5)
follow-up: 2 comment:1 by , 12 years ago
Keywords: | FFMPEG mul type mismatch removed |
---|---|
Version: | unspecified → git-master |
comment:2 by , 12 years ago
Replying to cehoyos:
Could you send a patch to ffmpeg-devel? It will create more attention there.
how to send to ffmpeg-devel? I just attached a patch file here.
comment:3 by , 12 years ago
Please update the patch, it does not apply anymore.
If you send the patch to the ffmpeg-devel mailing list - http://ffmpeg.org/mailman/listinfo/ffmpeg-devel - it will create more attention.
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch updated and applied
thanks
Could you send a patch to ffmpeg-devel? It will create more attention there.