https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258079
David Chisnall <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |Works As Intended Status|New |Closed CC| |[email protected] --- Comment #4 from David Chisnall <[email protected]> --- The code in the test case contains undefined behaviour. `IntBits` is 64 - 20, whcih is 44. `1U` is an `unsigned int`, which is 32 bits. `1U<<44` is a shift of greater than the width od the type, which is undefined behaviour. This is *probably* benign here, because array sizes in arguments in C/C++ are ignored and so this probably won't propagate into the generated IR (though if it does, both clang and GCC will take advantage of the UB and probably reduce this to something that traps. The correct fix is to change `1U` to `1ULL`. Rejecting code that contains undefined behaviour is both allowed by the standard and generally considered more user-friendly behaviour than accepting it and generating broken code. -- You are receiving this mail because: You are the assignee for the bug.
