In perl.git, the branch smoke-me/khw-register has been created

<http://perl5.git.perl.org/perl.git/commitdiff/90bbf7014958df12499d8cadb7f077a96d131f86?hp=0000000000000000000000000000000000000000>

        at  90bbf7014958df12499d8cadb7f077a96d131f86 (commit)

- Log -----------------------------------------------------------------
commit 90bbf7014958df12499d8cadb7f077a96d131f86
Author: Karl Williamson <[email protected]>
Date:   Thu Aug 16 10:50:14 2012 -0600

    Omnibus removal of register declarations
    
    This removes most register declarations in C code (and accompanying
    documentation) in the Perl core.  Retained are those in the ext
    directory, Configure, and those that are associated with assembly
    language.
    
    See:
    
http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c
    
    which says, in part:
    
    There is no good example of register usage when using modern compilers
    (read: last 10+ years) because it almost never does any good and can do
    some bad. When you use register, you are telling the compiler "I know
    how to optimize my code better than you do" which is almost never the
    case. One of three things can happen when you use register:
    
        The compiler ignores it, this is most likely. In this case the only
            harm is that you cannot take the address of the variable in the
            code.
        The compiler honors your request and as a result the code runs slower.
        The compiler honors your request and the code runs faster, this is the 
least likely scenario.
    
    Even if one compiler produces better code when you use register, there
    is no reason to believe another will do the same. If you have some
    critical code that the compiler is not optimizing well enough your best
    bet is probably to use assembler for that part anyway but of course do
    the appropriate profiling to verify the generated code is really a
    problem first.
-----------------------------------------------------------------------

--
Perl5 Master Repository

Reply via email to