diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-10-25 10:39:20 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-10-25 10:39:20 +0200 |
commit | 7d888535f7ab80e9b08a633bfd774a923b311cde (patch) | |
tree | 5f61b07097071bb42a178ca4b8677eb0a427d96f /gcc/gimplify.cc | |
parent | 354c97ee05b23707efbfc7ff6640dcec7336ac7a (diff) | |
download | gcc-7d888535f7ab80e9b08a633bfd774a923b311cde.zip gcc-7d888535f7ab80e9b08a633bfd774a923b311cde.tar.gz gcc-7d888535f7ab80e9b08a633bfd774a923b311cde.tar.bz2 |
gimplify: Don't add GIMPLE_ASSUME if errors were seen [PR107369]
The FEs emit errors about jumps into assume attribute conditions,
but when we add GIMPLE_ASSUME for the condition which is reachable
through those jumps, we can run into cfg verification diagnostics.
Fixed by throwing the IFN_ASSUME away during gimplification if
seen_error () - like we already do for -O0. GIMPLE_ASSUME in the middle-end
is a pure optimization thing and if errors were reported, the optimizations
will not be beneficial for anything.
2022-10-25 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/107369
* gimplify.cc (gimplify_call_expr): If seen_error, handle complex
IFN_ASSUME the same as for -O0.
* gcc.dg/attr-assume-4.c: New test.
* g++.dg/cpp23/attr-assume8.C: New test.
Diffstat (limited to 'gcc/gimplify.cc')
-rw-r--r-- | gcc/gimplify.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 69bad34..44cc9e6 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -3568,7 +3568,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value) return GS_OK; } /* If not optimizing, ignore the assumptions. */ - if (!optimize) + if (!optimize || seen_error ()) { *expr_p = NULL_TREE; return GS_ALL_DONE; |