"Johannes Pfau"  wrote in message news:maotpd$1ape$1...@digitalmars.com...

but if you instead write
@property ref Volatile!ubyte PORTA()
{
    return *(cast(Volatile!(ubyte)*)0x05)
}

PORTA |= now calls a function behind the scenes. The backend does not
immediately know that &PORTA is always 0x05. Also the this pointer in
opopAssign is no longer a compile time constant. And this is were the
constant/runtime value code gen difference discussed above matters.

It may not immediately know, but with guaranteed inlining it becomes a non-issue.

-O mostly fixes performance problems, but adding an additional property
function is still much uglier than declaring an extern variable with an
address in many ways. (compiler bugs, user-facing code, debug info, ...)

I agree that pragma(address) is nicer.

Reply via email to