4.9.0 miscompiles fflush (possibly other functions) in musl. Testcase: static int dummy = 0; extern int foo __attribute__((__weak__, __alias__("dummy"))); int bar() { if (foo) return 1; return 0; } dirtyepic@caribou ~/tmp $ gcc-4.8.2 -O2 -c pr61144.c -o pr61144 dirtyepic@caribou ~/tmp $ objdump -dr pr61144 pr61144: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <bar>: 0: 8b 15 00 00 00 00 mov 0x0(%rip),%edx # 6 <bar+0x6> 2: R_X86_64_PC32 foo-0x4 6: 31 c0 xor %eax,%eax 8: 85 d2 test %edx,%edx a: 0f 95 c0 setne %al d: c3 retq dirtyepic@caribou ~/tmp $ gcc-4.9.0 -O2 -c pr61144.c -o pr61144 dirtyepic@caribou ~/tmp $ objdump -dr pr61144 pr61144: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <bar>: 0: 31 c0 xor %eax,%eax 2: c3 retq I'll do a backport once a patch has been approved upstream.
fix is included in gcc-4.9.2