[LLVMbugs] [Bug 19500] Right-shift operator returns incorrect and inconsistent values

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 21 09:48:25 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19500

octoploid <octoploid at yandex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |octoploid at yandex.com
         Resolution|---                         |INVALID

--- Comment #2 from octoploid <octoploid at yandex.com> ---
markus at x4 tmp % clang++ -fsanitize=undefined -O2 shift.cpp
markus at x4 tmp % ./a.out
shift.cpp:26:19: runtime error: shift exponent 1291394886 is too large for
64-bit type 'long'
shift.cpp:28:65: runtime error: shift exponent 1291394886 is too large for
64-bit type 'long'
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/bits/ios_base.h:96:24:
runtime error: load of value 4294967221, which is not a valid value for type
'std::_Ios_Fmtflags'
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/include/g++-v4/bits/ios_base.h:76:67:
runtime error: load of value 4294967221, which is not a valid value for type
'std::_Ios_Fmtflags'
shift.cpp:28:189: runtime error: shift exponent 1291394886 is too large for
64-bit type 'long'
Main: 48271 >> 1291394886 = 140734713298048; rx=4341504=0x1002=long:4341504;
(lx>>ix)=long:140734713298048
shift.cpp:16:19: runtime error: shift exponent 1291394886 is too large for
64-bit type 'long'
shift.cpp:18:73: runtime error: shift exponent 1291394886 is too large for
64-bit type 'long'
shift.cpp:18:197: runtime error: shift exponent 1291394886 is too large for
64-bit type 'long'
Test: 48271 >> 1291394886; (lx>>ix)=754; rx=754=0x2f2=long:754;
(lx>>ix)=long:754
lx (8 bits) = 48271 =  = bc8f
ix (4 bits) = 1291394886 =  = 4cf91f46

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140421/139c400b/attachment.html>


More information about the llvm-bugs mailing list