https://bugs.llvm.org/show_bug.cgi?id=41875
Sanjay Patel <spatel+l...@rotateright.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
CC| |spatel+l...@rotateright.com
Status|NEW |RESOLVED
--- Comment #1 from Sanjay Patel <spatel+l...@rotateright.com> ---
The function invokes undefined behavior, so anything is possible.
You can test for that by adding a 'main' wrapper and:
$ clang -fsanitize=undefined 41875.c
$ ./a.out
41875.c:9:14: runtime error: shift exponent 32 is too large for 32-bit type
'uint32_t' (aka 'unsigned int')
For safe code and likely better code optimization, you may want to use the
clang builtins for bitwise rotation:
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs