This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Possible bug with builtin memset ?


	The following example patch (not meant for inclusion) exposes
a bug in gcc, If I apply it against today's CVS, I cannot bootstrap on
i686-pc-linux-gnu:

diff -rup orig/egcs-CVS20000222/gcc/system.h egcs-CVS20000222/gcc/system.h
--- orig/egcs-CVS20000222/gcc/system.h	Fri Feb 18 11:40:07 2000
+++ egcs-CVS20000222/gcc/system.h	Tue Feb 22 17:15:36 2000
@@ -331,6 +331,9 @@ extern void bzero PARAMS ((PTR, size_t))
 # endif
 #endif
 
+#undef bzero
+#define bzero(dst,len) __builtin_memset ((dst),0,(len))
+
 #ifndef index
 # ifdef HAVE_INDEX
 #  ifdef NEED_DECLARATION_INDEX


this is the error I get in stage 2:

 > [...]
 > _divdi3
 > ../../egcs-CVS20000222/gcc/libgcc2.c: In function `__divdi3':
 > ../../egcs-CVS20000222/gcc/libgcc2.c:753: Internal compiler error in
 > 	`schedule_insns', at haifa-sched.c:6988
 > Please submit a full bug report.
 > See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 > make[2]: *** [libgcc2.a] Error 1

So I believe either builtin memset has a bug, or one of the bzero
calls is buggy and the builtin memset exposes it better than the
libc bzero.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]