freebsd-skq/contrib
David E. O'Brien ec9ec8af6a Gcc 3.1 (-O) now generates broken inline code for memset in some cases.
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
2002-06-04 18:04:27 +00:00
..
amd sys_nerr should come from standard headers -- not from a coder's guess 2002-05-09 00:41:18 +00:00
awk Tighten up the random seeding a little bit more. getpid() alone only 2001-11-03 02:14:10 +00:00
bc This commit was generated by cvs2svn to compensate for changes in r90238, 2002-02-05 09:17:24 +00:00
bind Repair a bug where type AAAA answer records were not displayed. 2002-05-22 14:27:35 +00:00
binutils Use the stock 2.12 snapshot version of this. 2002-04-12 19:55:38 +00:00
bzip2 Add upgrade instructions. 2002-02-01 16:34:13 +00:00
com_err
cpio
cvs CVS_RSH defaults to 'ssh' these days, and not 'rsh'. 2002-05-12 02:12:04 +00:00
diff Fix essential typo in usage 2002-05-19 10:40:15 +00:00
file This commit was generated by cvs2svn to compensate for changes in r84685, 2001-10-08 22:50:54 +00:00
gcc Gcc 3.1 (-O) now generates broken inline code for memset in some cases. 2002-06-04 18:04:27 +00:00
gdb Use these malloc-like bits from libiberty now. 2002-01-27 12:45:01 +00:00
gperf
groff MFV: Initialize %I register. 2002-01-18 15:28:32 +00:00
ipfilter This commit was generated by cvs2svn to compensate for changes in r95567, 2002-04-27 17:01:32 +00:00
isc-dhcp Document recent DHCP upgrade. 2002-04-01 08:44:51 +00:00
less Merge vendor changes onto mainline. 2002-01-07 20:37:09 +00:00
libf2c Gcc 3.1.0 pre-release's libf2c bits from the FSF anoncvs repo on 2002-05-09 22:47:59 +00:00
libio Remove files that have been removed from vendor branch 2002-01-27 22:41:09 +00:00
libobjc Gcc 3.1.0 pre-release's Objective C support bits from the FSF anoncvs repo 2002-05-09 22:50:04 +00:00
libpcap Correct email address for bug reports and patch submissions. 2002-02-08 19:45:58 +00:00
libreadline
libstdc++ Gcc 3.1.0 pre-release's C++ support bits from the FSF anoncvs repo 2002-05-28 16:16:03 +00:00
lukemftp Import the FreeBSD differences Luke patched in lukemftp: 2002-04-26 16:51:03 +00:00
lukemftpd Import of LukeM's ftpd version 1.2 Beta 1. 2002-03-14 19:25:32 +00:00
ncurses This commit was generated by cvs2svn to compensate for changes in r97055, 2002-05-21 06:52:47 +00:00
ntp Merge after 4.1.0 import. 2001-08-29 15:15:59 +00:00
nvi Merge rev 1.1.1.3 from vendor branch: fix refresh / warning deadlock 2002-01-31 14:23:49 +00:00
one-true-awk This commit was generated by cvs2svn to compensate for changes in r92422, 2002-03-16 16:50:57 +00:00
openpam Vendor import of OpenPAM Cinquefoil. 2002-05-24 13:18:43 +00:00
opie Resolve conflicts. 2002-03-21 23:42:52 +00:00
pam_modules/pam_passwdqc Vendor import of pam_passwdqc v0.5. 2002-04-16 22:25:21 +00:00
patch
pnpinfo
sendmail Resolve conflicts from import of post-8.12.3 bug fixes. 2002-04-20 20:34:16 +00:00
smbfs This commit was generated by cvs2svn to compensate for changes in r95267, 2002-04-22 16:15:20 +00:00
sort Original code bugfixed. This NOT touch old sorting order a bit. 2002-04-07 00:49:00 +00:00
tar Move patches into the src/contrib/tar. 2002-06-04 17:31:16 +00:00
tcp_wrappers
tcpdump Quick hack to print out the non-standard pppoe used by 3com 2001-09-27 08:02:27 +00:00
tcsh This commit was generated by cvs2svn to compensate for changes in r90446, 2002-02-10 04:40:26 +00:00
telnet Don't risk catching a signal while handling a signal for a dying child, as we 2002-05-27 08:10:24 +00:00
texinfo Update for GNU texinfo 4.1. 2002-03-25 13:16:33 +00:00
top Resolve conflicts. 2002-01-24 17:58:42 +00:00
traceroute