]> git.ipfire.org Git - thirdparty/gcc.git/commit
gimple: allow fold_stmt without setting cfun in case of GIMPLE_COND folding
authorAndrew Pinski <quic_apinski@quicinc.com>
Tue, 13 May 2025 16:56:13 +0000 (09:56 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Wed, 14 May 2025 14:52:32 +0000 (07:52 -0700)
commit1759734f1584a3db75c5a931bc1b144b7695b80a
tree5a6f296faf282311ab841f85d032907b0db5224e
parent398c6ddf1e81ba0cfd14a600ff8ceb4611fc8cf6
gimple: allow fold_stmt without setting cfun in case of GIMPLE_COND folding

This is the followup mentioned in https://gcc.gnu.org/pipermail/gcc-patches/2025-May/683444.html .
It adds the check for cfun before accessing function specific flags.
We handle the case where !cfun as conservative in that it the function might throw.

gcc/ChangeLog:

* gimple-fold.cc (replace_stmt_with_simplification): Check cfun before
accessing cfun.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/gimple-fold.cc