[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] register keyword?

From: Gary E. Miller
Subject: Re: [gpsd-dev] register keyword?
Date: Mon, 22 Jan 2018 15:25:59 -0800

Yo Kurt!

On Mon, 22 Jan 2018 15:04:13 -0800
Kurt Schwehr <address@hidden> wrote:

> The general compiler folks consensus is that the optimizers generally
> just ignore register and it's being removed from C++17.  Linking
> against C++17 code is my main reason for this.

Uh, this is C code, not C++ code.  What are you linking it to?

> But that's why we have to easily try it out.

Well, that is fun.  It also shows the register keyword really helps.  Ar
least when I select a C compiler.

> Looking at gcc x86-64 7.2, the assembly without register is shorter.

I see your point in C++ mode, but not in C mode.  In C mode the
register keyword is a real win.

>    #pragma GCC optimize("O3")
> The assembly with and without registers is exactly the same.

Except gpsd does not use -O3.  I see similar on -o2, which gpsd does
use, except that optimization will not work for a linked in function.

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgpvvNhsmiqX6.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]