Current GDC experience and questions
Timo Sintonen
t.sintonen at luukku.com
Fri Mar 8 23:09:25 PST 2013
On Friday, 8 March 2013 at 18:16:18 UTC, Iain Buclaw wrote:
>> > > Yet not all attributes that GCC offers actually make sense
>> > > to have
>> > > in D. We certainly need to have a review of each one and
>> > > discuss
>> > > what is most important to have. Also defining our own
>> > > unique
>> > > attributes along the way. :o)
>> > >
I think that in pc programs there should be no need for
attributes but in embedded systems they are useful.
I hope that we will get the freestanding option soon to make the
code smaller and simpler.
I find need for inlining attributes in interrupts and callbacks.
For example:
Uart1_interrupt() {
serial_int_handler(uart1);
}
Uart2_interrupt() {
serial_int_handler(uart2);
}
...
Here I need to control whether I want to duplicate the handler
code because of speed or do I want to save memory by not inlining.
Target options are useful when the same program is used in
different processor families. The general code should be targeted
to run in all versions of hardware and product specific code may
be targeted to the actual processor used.
For example: in the products I make, the battery powered versions
use Cortex-m3 and mains powered versions use Cortex-m4
I have also found an use for optimize: a while ago I pointed out
that global variables are optimized out in loops. Now I have to
compile separately those files that access volatile registers,
with no optimization. The other files I compile with
optimizations.
More information about the D.gnu
mailing list