------- Comment #4 from tg at mirbsd dot org 2007-03-10 20:31 ------- It's not fixed on 4.1 branch:
[EMAIL PROTECTED]:~/tmp $ cat _t.c typedef unsigned size_t; char *xxcpy( char *pDest, const char *pSrc, size_t n); char *strncpy( char *pDest, const char *pSrc, size_t n) { if (pDest == 0 || pSrc == 0) { if (pDest) *pDest = 0; return pDest; } return xxcpy (pDest, pSrc, n); } Neither with 4.1.2 (release): [EMAIL PROTECTED]:~/tmp $ ~/tmp/gp/bin/gcc -O2 -S _t.c -o - .file "_t.c" .text .p2align 4,,15 .globl strncpy .type strncpy, @function strncpy: pushl %ebp movl %esp, %ebp popl %ebp jmp xxcpy .size strncpy, .-strncpy .ident "GCC: (GNU) 4.1.2" .section .note.GNU-stack,"",@progbits Nor with today's weekly snapshot: [EMAIL PROTECTED]:~/tmp $ ~/tmp/gp/bin/gcc -O2 -S _t.c -o - .file "_t.c" .text .p2align 4,,15 .globl strncpy .type strncpy, @function strncpy: pushl %ebp movl %esp, %ebp popl %ebp jmp xxcpy .size strncpy, .-strncpy .ident "GCC: (GNU) 4.1.3 20070305 (prerelease)" .section .note.GNU-stack,"",@progbits For the meantime, I'm using -fno-tree-vrp as well, but this is a serious bug, please fix it. (tried to reopen the PR but that didn't work) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30785