https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117295
Bug ID: 117295 Summary: ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:957 with returns_twice and -O1 -fsanitize=address -finstrument-functions Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: iamanonymous.cs at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- Maybe similar to bug 114687. There is something broken with -fsanitize=address -finstrument-functions and returns_twice. Program: $ cat mutant.c long b; void abort(); void __attribute__((returns_twice)) a() { abort(); } void d(); void c() { switch (b) { case 6: a(); case 0: d(); } } Command Lines: $ gcc -O1 -fsanitize=address -finstrument-functions mutant.c during GIMPLE pass: asan mutant.c: In function 'c': mutant.c:5:6: internal compiler error: in edge_before_returns_twice_call, at gimple-iterator.cc:957 5 | void c() { | ^ 0x5071bcf diagnostic_context::report_diagnostic(diagnostic_info*) ???:0 0x50724a1 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x50924c7 internal_error(char const*, ...) ???:0 0x50729e4 fancy_abort(char const*, int, char const*) ???:0 0x160e0b1 gsi_safe_insert_before(gimple_stmt_iterator*, gimple*) ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Godbolt link: https://godbolt.org/z/Tx67TxvPd