H1 2015 Priorities and Bare-Metal Programming

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 2 22:18:31 PST 2015


On 2 Feb 2015 23:45, "Walter Bright via Digitalmars-d" <
digitalmars-d at puremagic.com> wrote:
>
> On 2/2/2015 2:30 PM, Johannes Pfau wrote:
>>
>> I does: if the backend can't know that a value is known at compile time
>> it cant use absolute addresses:
>>
>> void test(ubyte* ptr)
>> {
>>      volatileLoad(ptr); //Can't use literal addressing might be runtime
>>      value
>> }
>>
>> The context here is that pragma(address) allows avoiding one wrapper
>> function. See below.
>
>
> Again, that is simply an inlining issue.
>
>
>
>> The pragma(address, 0x05) makes sure that the compiler backend always
>> knows that PORTA is at 0x05.
>
>
> Constant propagation and inlining do that. Both are standard
optimizations that every compiler does. Adding language features on the
presumption that compilers won't do that is like trying to fix the broken
engine in your car by adding another engine in the trunk.
>
>
>
>> -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,
>
>
> Language features should not be added because of compiler bugs.
>
>> user-facing code,
>
>
> Library wrapper types will be showing up more and more. How nice they are
is up to the library designer.
>
>
>> debug info, ...)
>
>
> Symbolic debugging is always going to be an issue until there are
debuggers that are better designed to work with D.
>

It's more a marriage than a one way street.  DMD still needs to produce the
goods in order for debuggers to turn it into meaningful data.

Iain.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150203/51fd046a/attachment-0001.html>


More information about the Digitalmars-d mailing list