https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120024
Bug ID: 120024 Summary: ICE (Segmentation fault) in expand_call when casting malloc to void (*)(void) and calling it Product: gcc Version: 15.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: mario.rodriguezb1 at um dot es Target Milestone: --- The following valid (but nonsensical) C code triggers a segmentation fault and an internal compiler error (ICE) in GCC: ``` #include <stdlib.h> int main() { ((void (*)(void))malloc)(); return 0; } ``` To reproduce quickly: I have tested all x86-64 gcc´s and the error arises in all of them. https://gcc.godbolt.org/z/eqhWeWTba