https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49697
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu.org --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- lo->fd = open (fname, (writable ? O_WRONLY | O_CREAT | O_BINARY : O_RDONLY | O_BINARY), 0666); Every other file that gets created by GCC is fopen which according to the man page: Any created file will have the mode S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH (0666), as modified by the process's umask value (see umask(2)). I would assume umask modifies open's mode too ... Let me try to dig into this slightly more tomorrow.