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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to