Do not use DW_OP_not for TRUTH_NOT_EXPR in conditional expressions
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 16 May 2022 08:44:09 +0000 (10:44 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 16 May 2022 09:08:47 +0000 (11:08 +0200)
commitad05a1d7f83aa7ddff9ac6ec5ca65e69042d6907
tree9e164141033230f595aa76bebafe43970f2bf0c0
parentc6ca39c7bf3b2ef24868885a22ff09b7490ffa8f
Do not use DW_OP_not for TRUTH_NOT_EXPR in conditional expressions

DW_OP_not is a bitwise, not a logical NOT, so it computes the wrong result
in a DWARF conditional expression.

gcc/
* dwarf2out.cc (loc_list_from_tree_1) <TRUTH_NOT_EXPR>: Do a logical
instead of a bitwise negation.
<COND_EXPR>: Swap the operands if the condition is TRUTH_NOT_EXPR.
gcc/dwarf2out.cc