[llvm-commits] proposed patch: shift when shift amount >= bit width
Lauro Ramos Venancio
lauro.venancio at gmail.com
Wed Jun 13 11:34:42 PDT 2007
>
> This is not enough to make a compiler handle shifts by greater than the
> word size consistently; in both gcc and llvm-gcc, for example, the
> result of
>
> int y=32;
> x>>y
>
> depends on optimization level.
I know. On x86, the result of
int n = 32;
1<<n
is 1 with "gcc -O0" and 0 with "gcc -O3". But some important programs
(like ffmpeg) use these shifts expecting the gcc behavior. The ffmpeg,
for example, works well with "gcc -O0" and "gcc -O3". So, for
compatibility purpose, I think we should implement the gcc behavior
and do not create another behavior.
Lauro
More information about the llvm-commits
mailing list