[Bug sanitizer/114687] [13/14 Regression] ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:981
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114687 --- Comment #4 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:c9e94ae448ba309dba74de3ee1974a3ed9248889 commit r14-9933-gc9e94ae448ba309dba74de3ee1974a3ed9248889 Author: Jakub Jelinek Date: Fri Apr 12 10:59:54 2024 +0200 Limit special asan/ubsan/bitint returns_twice handling to calls in bbs with abnormal pred [PR114687] The tree-cfg.cc verifier only diagnoses returns_twice calls preceded by non-label/debug stmts if it is in a bb with abnormal predecessor. The following testcase shows that if a user lies in the attributes (a function which never returns can't be pure, and can't return twice when it doesn't ever return at all), when we figure it out, we can remove the abnormal edges to the "returns_twice" call and perhaps whole .ABNORMAL_DISPATCHER etc. edge_before_returns_twice_call then ICEs because it can't find such an edge. The following patch limits the special handling to calls in bbs where the verifier requires that. 2024-04-12 Jakub Jelinek PR sanitizer/114687 * gimple-iterator.cc (gsi_safe_insert_before): Only use edge_before_returns_twice_call if bb_has_abnormal_pred. (gsi_safe_insert_seq_before): Likewise. * gimple-lower-bitint.cc (bitint_large_huge::lower_call): Only push to m_returns_twice_calls if bb_has_abnormal_pred. * gcc.dg/asan/pr114687.c: New test.
[Bug sanitizer/114687] [13/14 Regression] ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:981
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114687 Jakub Jelinek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Created attachment 57929 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57929=edit gcc14-pr114687.patch Untested fix. The tree-cfg.cc verification that ECF_RETURNS_TWICE call is the first in bb appart from labels/debug stmts is keyed on it appearing in a bb which has abnormal predecessor, this patch guards the code that attempts to maintain that invariant on the same condition.
[Bug sanitizer/114687] [13/14 Regression] ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:981
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114687 --- Comment #2 from Jakub Jelinek --- Saying a function is valid code in this case is difficult, claiming that a noreturn function is pure or returns_twice is wrong, it isn't pure, nor returns_twice, as it never returns.
[Bug sanitizer/114687] [13/14 Regression] ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:981
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114687 Richard Biener changed: What|Removed |Added Priority|P3 |P1
[Bug sanitizer/114687] [13/14 Regression] ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:981
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114687 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Target Milestone|--- |13.3 Last reconfirmed||2024-04-11 Known to fail||14.0 Summary|ICE: in |[13/14 Regression] ICE: in |edge_before_returns_twice_c |edge_before_returns_twice_c |all, at |all, at |gimple-iterator.cc:981 |gimple-iterator.cc:981 Status|UNCONFIRMED |NEW Known to work||13.2.0 --- Comment #1 from Andrew Pinski --- Confirmed. I suspect the patches which fixed PR 112709 caused this one which so this is also a regression on the GCC 13 branch too.