-
Bug
-
Resolution: Fixed
-
Medium
-
Code Generation Tools
-
CODEGEN-12801
-
-
-
default
At optimization level -O2 or higher, the optimizer may incorrectly truncate values larger than the size of "bool" when using a ternary (? operator is used to compute a boolean value. The exact conditions for this to occur are not clear, because the compiler can transform conditional statements (like if statements) into the ternary operator, which can trigger the bug. This bug has only been observed for C6x in C++ mode, when the original test case does not directly use the ternary operator, and the boolean value being computed is stored in a struct member with type "bool," but it may occur under other conditions.
if (!data[0] && !data[1]) s.b = true else s.b = false;