Re: Adventures with gcc: code vs object-code size

From: Marc Olzheim (marcolz_at_stack.nl)
Date: 03/21/04

  • Next message: M. Warner Losh: "Re: bus_alloc_resource() returns NULL, but why?"
    Date: Sun, 21 Mar 2004 15:13:30 +0100
    To: Peter Jeremy <peterjeremy@optushome.com.au>
    
    

    On Sun, Mar 21, 2004 at 07:45:43PM +1100, Peter Jeremy wrote:
    > But (IMHO) this is a lot less clear than the former code (thought I admit
    > I'm guilty of doing this quite a lot in my code). Note that a modern C
    > compiler is free to convert
    > strcpy(elemcopy, ":") == 0
    > into
    > elemcopy[0] == ':' && elemcopy[1] == '\0'
    > assuming the relevant header (<string.h>) is in scope. (I was under the
    > impression that gcc did this).

    You're mixing up strcpy() with strcmp(), but you are right, unless
    -fno-builtin is specified.

    Marc
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: M. Warner Losh: "Re: bus_alloc_resource() returns NULL, but why?"

    Relevant Pages

    • Re: The performance of all kinds of C operations
      ... It depends on your compiler. ... This is probably the easiest case where a good modern ... was better because it performed fewer actual ALU operations on average. ... CPUs, it turns out that ALU speed has gone way up relative to branch ...
      (comp.lang.c)
    • Re: D.H. Brown: EV7 AlphaServers Deliver Enhanced RAS and Powerful
      ... > does special work to get that stuff fast under EPIC, ... > compiler is guilty of the same juicing. ... is true from any source (I don't know the people who did the benchmarks). ...
      (comp.os.vms)
    • Re: To Richard Heathfield: enoughs enough
      ... > But in fact, I'm afraid, developing a compiler meant to show a modern ... > GUI and in source code formatted and read by humans FOR ANY ... It's not a compiler but an interpreter. ... to show a modern GUI?" ...
      (comp.programming)
    • Re: Man takes photos of girl, 9
      ... >Shirley Temple was paid a heck of a lot more than that, ... >How the heck do you "give the impression" that someone is naked ... Photos showing shoulders naked, maybe a lot of leg too. ... Do you think anyone will plead guilty to a charge like that if they ...
      (uk.legal)
    • Re: Interrupt in C
      ... Its not a standard C function, and how it works is platform specific. ... mind that using an old compiler on a modern OS may not succeed, ...
      (comp.lang.c)