Branch: Tag:

2014-05-23

2014-05-23 19:48:31 by Arne Goedeke <el@laramies.com>

Stdio: use -Os for file.c with gcc

gcc -O3 generates extremely bloated code for functions in file.c, even
though it makes no sense to unroll the loop around open(2).

145:   #define UNIX_SOCKET_CAPABILITIES (fd_INTERPROCESSABLE | fd_BIDIRECTIONAL | fd_CAN_NONBLOCK | fd_CAN_SHUTDOWN | fd_SEND_FD)   #endif    + /* +  * gcc with -O3 generates very bloated code for the functions in this file. One rather extreme example +  * is file_open, which ends up having 32 call sites of open(2). +  */ + #ifdef __GNUC__ + #pragma GCC optimize "-Os" + #endif +    /* #define SOCKETPAIR_DEBUG */      struct program *file_program;