https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98070
--- Comment #5 from stli at linux dot ibm.com <stli at linux dot ibm.com> --- I've just build and run the attached test on s390x/x86_64 with your fix. Now errno is re-evaluated after realloc. I've also rebuild glibc on s390x and the original glibc-test <glibc>/malloc/tst-malloc-too-large.c is now also passing. Many thanks.