bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/19311] arm-linux-as build on Mac OS X with Xcode7 fails to


From: Loria at phantasia dot org
Subject: [Bug binutils/19311] arm-linux-as build on Mac OS X with Xcode7 fails to assemble code from FreePascal cross-compiler
Date: Wed, 27 Jan 2016 20:22:41 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19311

--- Comment #13 from Loria <Loria at phantasia dot org> ---
<QUOTE https://llvm.org/bugs/show_bug.cgi?id=26344 <>
$ clang -fsanitize=undefined test.c -o test && ./test
test.c:11:13: runtime error: shift exponent 32 is too large for 32-bit type
'unsigned int'
0xA7 0xA7
0x1 0x1
0x0 0x0

line 11 has:
    if((a = rotate_left (val, i)) <= 0xFF)

expands to:
    if((a = (val << i | val >> (32 - i))) <= 0xFF)

when i == 0, we will compute:
    if((a = (val << 0 | val >> (32 - 0))) <= 0xFF)

val >> 32 is undefined behavior.
</QUOTE>
I am unsure if that is correct, since I never experienced on any machine any
problem doing >>32 (resulted in 0 as expected on all machines i did it)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]