From owner-freebsd-current Mon Jun 3 18:13: 5 2002 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 1302937B409; Mon, 3 Jun 2002 18:13:01 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id LAA26854; Tue, 4 Jun 2002 11:12:58 +1000 Date: Tue, 4 Jun 2002 11:16:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: current@FreeBSD.ORG Cc: obrien@FreeBSD.ORG Subject: Re: memset() broken in gcc-3.1 on i386's In-Reply-To: <20020604084202.Q939-100000@gamplex.bde.org> Message-ID: <20020604110707.H1982-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 4 Jun 2002, I wrote: > gcc now generates inline code for memset in some cases. Broken code. Actually, it only generates inline code for memset in a few more cases, and the case of a non-constant length is broken (and some cases of constant lengths are pessimized (e.g., length 7)). > ... > This broke newfs (newfs left some garbage in a bitmap). Actually, it broke fsck_ffs. Workaround to avoid the known broken case: %%% Index: builtins.c =================================================================== RCS file: /home/ncvs/src/contrib/gcc/builtins.c,v retrieving revision 1.1.1.3 diff -u -2 -r1.1.1.3 builtins.c --- builtins.c 13 May 2002 03:35:47 -0000 1.1.1.3 +++ builtins.c 4 Jun 2002 00:53:22 -0000 @@ -2195,4 +2195,9 @@ len_rtx = expand_expr (len, NULL_RTX, VOIDmode, 0); + /* Give up for non-constant lengths. They are broken on at least + i386's. */ + if (GET_CODE (len_rtx) != CONST_INT) + return 0; + dest_mem = get_memory_rtx (dest); set_mem_align (dest_mem, dest_align); %%% Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message