mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-01 16:34:06 +08:00
d: Don't generate a PREDICT_EXPR when assert contracts are turned off.
This expression is just discarded by add_stmt, so never reaches the middle-end. gcc/d/ChangeLog: * expr.cc (ExprVisitor::visit (AssertExp *)): Don't generate PREDICT_EXPR.
This commit is contained in:
parent
c18db639a3
commit
5ad4eab2e6
@ -2085,15 +2085,9 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Assert contracts are turned off, if the contract condition has no
|
||||
side effects can still use it as a predicate for the optimizer. */
|
||||
if (TREE_SIDE_EFFECTS (arg))
|
||||
{
|
||||
this->result_ = void_node;
|
||||
return;
|
||||
}
|
||||
|
||||
assert_fail = build_predict_expr (PRED_NORETURN, NOT_TAKEN);
|
||||
/* Assert contracts are turned off. */
|
||||
this->result_ = void_node;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Build condition that we are asserting in this contract. */
|
||||
|
Loading…
Reference in New Issue
Block a user