https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94541
--- Comment #5 from Iain Buclaw <ibuclaw at gdcproject dot org> --- (In reply to H.J. Lu from comment #3) > .L8: > subl $8, %esp > .cfi_def_cfa_offset 16 > movq %rdi, %rsi <<<<<< It should be movl %edi, %esi > shrq $32, %rdi > call munmap > addl $8, %esp > .cfi_def_cfa_offset 8 Confirmed on my end, if I compile with -O1 -mx32 -S, and make this change, the call succeeds.