When compile this program with GCC-14, GCC crashes: ``` __GIMPLE (ssa) int foo (int *a) { return 0; return 0; } ``` Compiler Explorer: https://godbolt.org/z/zecdo68WE The full stack dump: ``` <source>: In function 'foo': <source>:5:1: internal compiler error: Segmentation fault 5 | } | ^ 0x22ff3ee internal_error(char const*, ...) ???:0 0xaad8ac c_parser_parse_gimple_body(c_parser*, char*, c_declspec_il, profile_count) ???:0 0xaa468d c_parse_file() ???:0 0xb17919 c_common_parse_file() ???: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. ```
Note even though the gimple FE exists, it is mainly designed ONLY for testsuite usage and that there will be many corner cases like this where code will cause an ICE rather than be rejected for being invalid.
Speicfically we're not interested in "fuzzing" it, but only cases you run into when you are trying to exercise it for its purpose.
Confirmed. /* We have a CFG. Build the edges. */ for (unsigned i = 0; i < parser.edges.length (); ++i) { edge e = make_edge (BASIC_BLOCK_FOR_FN (cfun, parser.edges[i].src), BASIC_BLOCK_FOR_FN (cfun, parser.edges[i].dest), parser.edges[i].flags); e->probability = parser.edges[i].probability; } make_edge is returning NULL.