https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88424
--- Comment #3 from Peter Damianov <peter0x44 at disroot dot org> --- Looking in a hex editor, what gcc is doing is changing the CRLF to LFLF, there is no CR in the output. /* If the file is using old-school Mac line endings (\r only), terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ if (to.len && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else to.text[to.len] = '\n'; I noticed this code, but commenting it out makes the compiler fail selftests. I'll keep looking to see if I can find the code responsible for doing that.