-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
clang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerundefined behaviour
Description
Putting these lines at the beginning of a function causes clang to remove the entire function. Does not happen if dummy variable inside the if
is removed. Can cause strange jumps to other functions. The UB does not cause this in GCC/MSVC.
unsigned A = 32;
unsigned B = 1 << A;
if (B) { unsigned Dummy; }
Clang version: 15+, works fine in clang 14.
Optimization level: -O1 or higher
Metadata
Metadata
Assignees
Labels
clang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerundefined behaviour