]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: don't fold away 'if' with constant condition
authorJason Merrill <jason@redhat.com>
Thu, 25 Nov 2021 15:50:59 +0000 (10:50 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 30 Nov 2021 21:05:24 +0000 (16:05 -0500)
commita3e75c1491cd2d501081210925a89a65b1c1e5e5
tree9efcd2c09b97a67d67d1ada9daa470d19b0a8c91
parent91c26004037db689954318d3d1c801eea18d45f4
c++: don't fold away 'if' with constant condition

richi's recent unreachable code warning experiments had trouble with the C++
front end folding away an 'if' with a constant condition.  Let's do less
folding at the statement level.

gcc/cp/ChangeLog:

* cp-gimplify.c (genericize_if_stmt): Always build a COND_EXPR.
gcc/cp/cp-gimplify.c