summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/builtins.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert rev. 1.2. GCC 3.2 seems to have builtin_memset fixed.kan2002-09-011-5/+0
| | | | Approved by: obrien
* Gcc 3.1 (-O) now generates broken inline code for memset in some cases.obrien2002-06-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This broke newfs (newfs left some garbage in a bitmap). The ASM for: #include <string.h> int x, foo[100]; main() { memset(&foo[0], 0, x); } is (at least if you have fixed function alignment): .file "z.c" .text .p2align 2,,3 .globl main .type main,@function main: pushl %ebp movl %esp, %ebp pushl %edi pushl %eax movl x, %ecx xorl %eax, %eax shrl $2, %ecx movl $foo, %edi cld rep stosl andl $-16, %esp <-- the lower bits of `len' should be loaded near here testl $2, %edi <-- this seems to be meant to test the 2^1 bit in `len' (not alignment of the pointer like it actually does). %edi is the wrong register for holding the bits, since it is still needed for the pointer. je .L2 stosw .L2: testl $1, %edi <-- similarly for the 2^0 bit. je .L3 stosb .L3: movl -4(%ebp), %edi leave ret .Lfe1: .size main,.Lfe1-main .comm foo,400,32 .comm x,4,4 .ident "GCC: (GNU) 3.1 [FreeBSD] 20020509 (prerelease)" This seems to only result in (len % 3) bytes not being cleared, since gcc doesn't seem to use the builtin memset unless it knows that the pointer is aligned. If %edi could be misaligned, then too many bytes would be set. Submitted by: BDE
* Gcc 3.1.0 pre-release from the FSF anoncvs repo on 9-May-2002 15:57:15 EDT.obrien2002-05-091-28/+62
|
* Enlist the FreeBSD-CURRENT users as testers of what is to become Gcc 3.1.0.obrien2002-02-011-0/+4126
These bits are taken from the FSF anoncvs repo on 1-Feb-2002 08:20 PST.
OpenPOWER on IntegriCloud