[comp.os.minix] Problems with C68

archer%segin4.segin.fr@prime.com (Vincent Archer) (06/05/90)

    I've found C68 to be very useful... But I've also found that it's not
reliable :-( Try compiling the lib/ansi/strcpy.c; the construction:

    while ((*dest++ = *src++) != 0) continue;

is compiled as:

_0:
    move.l    a2,a0
    add.l     #1,a2
    move.b    (a3)+,(a0)
    tst.b     (a3)+               <==== Uh? A second increment
    bne       _0

Aside from the optimisation problem of dst++, there's a problem in the
reduction of the expression (a=b)op => (a=b),(b op), which is safe as long as
b is safe to evaluate more than once.

No wonder you get 1018 dhrystones/sec. that way! :-) I lack the time to fix it,
so, CvW, you're notified of the problem...


    Vincent


Vincent Archer                   | Email:archer%segin4.segin.fr@prime.com
"People that are good at finding excuses are never good at anything else"

HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) (06/05/90)

Well I found that error too when prepearing other dhrystone results.
I introduced this error when prepearing patch_2.
This fix is trivial. Patch_3 is in preparation and fixes this error and
the following two points:

-functions with body, declared extern, become global

-repeated global declarations, although illegal, won't reserve storage
 more than once (try to compile more.c, where the global variable ch is
 defined twice, at the beginning and before function colon()

BUT, Thank you very much for the bug report, I need them. Meanwhile, it
is much harder finding the remaining bugs than to fix them.
C.v.W.