[lkml]   [1999]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: linux-2.3.4pre1: Adjustments for using gcc builtins
    Linus Torvalds <> said:
    > On Fri, 28 May 1999, Horst von Brand wrote:
    > > After the recent problems with egcs snapshots, it was suggested that the
    > > kernel don't use handcrafted mem* and str* functions, it better use the gcc
    > > builtins. This gives rise to the first patch below: It just blows away the
    > > redundant definitions in include/asm-i386/string.h and adds the symbols for
    > > the functions to kernel/ksyms.c (gcc doesn't allways inline them for some
    > > reason, falling back on the library functions).

    > Thcc gcc "builtins" are generally noticeably worse than the kernel
    > headers.

    I'll have to check on that.

    > Anyway, there is a really simple choice when it comes to compilers: we
    > will choose the one that generates better code. For a long time it
    > _seemed_ that egcs would be the choice, but if we have to disable the new
    > alias code and/or use ugly tricks like the above then the choice is fairly
    > clear - gcc-2.7.2 will still continue to generate better code.

    How is using gcc builtins instead of reimplementations thereof a "ugly
    trick"? Sure, there are now problems with the new aliasing code: Here egcs
    introduces a new optimization that gives _better_ code overall. But that
    happens to clash with the way the kernel is written, as has happened

    > I've asked the egcs people to give us some way to tell the compiler what's
    > going on, but at least so far I haven't had any replies. As I know how
    > gcc-2.7.2 can be made to generate the code I want, and nobody so far has
    > told me how to get egcs to do the same, I know which compiler _I_ will
    > recommend.

    In this case you can get that (more or less) by foregoing strict aliasing
    and using the string.h implementations as they stand.
    Horst von Brand
    Casilla 9G, Viña del Mar, Chile +56 32 672616

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:52    [W:0.030 / U:7.808 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site