egcs-1.1 in SCOV5 changes memcpy() into buggy SCO bcopy()

Robert Lipe robertl@dgii.com
Thu Sep 17 09:59:00 GMT 1998


> I discovered one problem with egcs-1.1 on SCO5, at least the one I use
> at work.

Luckily for you, I happen to be working on EGCS on OpenServer at this very
moment, so I was able to throw this in during a test build.

> When a C program uses memcpy(), the assembly generated calls bcopy().

I never noticed that before.   I was pretty mystified.   I ran the same
compiler source on a Linux system and generated more obvious output.

> But ... memmove is very very slow in SCO.. you already know that ? 


In general, I suspect most memmoves are slower than most memcpys.  It 
just plain does more.

> (in SCO 4.2, it was buggy...)

3.2v4.2 had native compilers and libraries based on old Microsoft stuff.
I suspect I don't have to say much more.

OpenServer has native compilers and libraries licensed from
USL/USG/Univel/Novell before they just plain purchased the group.
You will find it to be a much more pleasant place to work.

> memcpy is speed/perfect (however, frame pointer is not set)

I think that it's speed perfect for 486 and down but leaves some clock
cycles on the table for modern parts.   But that's beyond the scope of
both my expertise and this discussion.

> What can I do in C programs if I want to call the real memcpy instead of
> bcopy ?

In my world, applying the following patch to gcc/config/i386/sco5.h,
removing expr.o and optabs.o and doing a 'make bootstrap3' generates the
results I think you're looking for.

If you can crank off a full bootstrap and regression test to be sure
this actually works, I'll commit this patch.

RJL


Index: config/i386/sco5.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/sco5.h,v
retrieving revision 1.18
diff -u -p -r1.18 sco5.h
--- sco5.h	1998/09/16 20:13:19	1.18
+++ sco5.h	1998/09/17 05:08:25
@@ -916,6 +916,11 @@ dtors_section ()							\
 
 #define NO_DOLLAR_IN_LABEL
 
+/* Implicit library calls should use memcpy, not bcopy, etc.  They are 
+   faster on OpenServer libraries. */
+
+#define TARGET_MEM_FUNCTIONS
+
 /*
 Here comes some major hackery to get the crt stuff to compile properly.
 Since we can (and do) compile for both COFF and ELF environments, we



More information about the Gcc mailing list