https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57438
--- Comment #26 from Uroš Bizjak <ubizjak at gmail dot com> --- + /* If we don't find any, we've got an empty function body; i.e. + completely empty - without a return or branch. Reaching an + empty function body means UB. Let's trap it. */ + if (insn == NULL) + fputs ("\thlt\n", file); Probably sou want to use ud2 instruction here.