The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.
IAR Optimizations - Your opinions.. - Andy Busa - Jul 1 9:11:46 2009
Hi all,
I have been using No optimizations when building. However, I am
starting to get tight on code space and using the Medium Optimizations
setting has yielded quite a bit of code space back.
How do people like or dislike the optimization that the IAR compiler
performs? I have an inherent fear of optimizations but I may have no
choice.
[Non-text portions of this message have been removed]
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: IAR Optimizations - Your opinions.. - Ian Okey - Jul 1 9:24:46 2009
I have been using the most aggressive optimisation for code size provided by
IAR ever since version 1.26 of the tools. Sometimes debugging gets
interesting as breakpoints do not necessarily appear exactly where I
expected them to but I have not had more than a couple of cases where the
code has been broken. These were specific unusual cases that resulted in a
bug fix/new issue of the compiler by IAR. (thanks Anders)
Ian
2009/7/1 Andy Busa
> Hi all,
>
> I have been using No optimizations when building. However, I am
> starting to get tight on code space and using the Medium Optimizations
> setting has yielded quite a bit of code space back.
>
> How do people like or dislike the optimization that the IAR compiler
> performs? I have an inherent fear of optimizations but I may have no
> choice.
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: IAR Optimizations - Your opinions.. - Microbit_P43000 - Jul 1 12:35:00 2009
I second that.
All these people that whinge about optimisation wrecking things - as a rule=
- will be
coding incorrectly.
I don't profess to be a "C expert", far from it, but I consider myself to h=
ave ample
enough knowledge by now to be aware of what's right and what's not vis-=E0-=
vis optimisation.
I used IAR myself for a few years and the only bug I ever came across for M=
SP430 with opt.
was the toupper() function (well, it was running as a macro that broke it).
Many here will know that I am a die hard fan of CrossWorks since several ye=
ars, but the
time that I owned IAR tools and used them professionally they certainly all=
owed me to earn
my crust - and be able to rely on them for that crust :-)
Best Regards,
Kris=20
> -----Original Message-----
> From: m...@yahoogroups.com [mailto:m...@yahoogroups.com] On Behalf Of=
Ian Okey
> Sent: Wednesday, 1 July 2009 11:19 PM
> To: m...@yahoogroups.com
> Subject: Re: [msp430] IAR Optimizations - Your opinions..
>=20
> I have been using the most aggressive optimisation for code size provided=
by
> IAR ever since version 1.26 of the tools. Sometimes debugging gets
> interesting as breakpoints do not necessarily appear exactly where I
> expected them to but I have not had more than a couple of cases where the
> code has been broken. These were specific unusual cases that resulted in=
a
> bug fix/new issue of the compiler by IAR. (thanks Anders)
>=20
> Ian
>=20
> 2009/7/1 Andy Busa
>=20
> > Hi all,
> >
> >
> >
> > I have been using No optimizations when building. However, I am
> > starting to get tight on code space and using the Medium Optimizations
> > setting has yielded quite a bit of code space back.
> >
> >
> >
> > How do people like or dislike the optimization that the IAR compiler
> > performs? I have an inherent fear of optimizations but I may have no
> > choice.
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> >
> >
> >

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re:IAR Optimizations - Your opinions.. - Nick Loy - Jul 2 12:59:11 2009
My experience is mid grade optimization usually works fine, maximum optimization almost
never works. Be absolutely sure all dynamic variables are declared as such.
Nick Loy
Principal Engineer
Product Resources LLC
148 Sohier Rd
Beverly MA 01915
978 524 8500
(Home) 603 882 6664
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re:IAR Optimizations - Your opinions.. - "Richard (UK)" - Jul 2 13:20:45 2009
My rule is : "ship what you test".
Do NOT test an instrumented debuild build and then turn on the optimiser 10
minutes before you ship.
If this means shipping code which takes up a bit more space and CPU than the
optimum, so be it.
The cost of a product recall can destroy companies, so don't suddenly
convert trusted & tested code into unknown code which you then give to
customers!
----- Original Message -----
From: Nick Loy
To: 'm...@yahoogroups.com'
Sent: Thursday, July 02, 2009 6:00 PM
Subject: [msp430] Re:IAR Optimizations - Your opinions..
My experience is mid grade optimization usually works fine, maximum
optimization almost never works. Be absolutely sure all dynamic variables
are declared as such.
Nick Loy
Principal Engineer
Product Resources LLC
148 Sohier Rd
Beverly MA 01915
978 524 8500
(Home) 603 882 6664
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re:IAR Optimizations - Your opinions.. - Jon Kirwan - Jul 2 14:10:05 2009
On Thu, 2 Jul 2009 18:19:30 +0100, you wrote:
>My rule is : "ship what you test".
>
Egads! How could there be any other option??? Do people actually
test with one compilation and then just recompile differently for
shipping and send out an untested one??? For real? Who would do
that?
Jon
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re:IAR Optimizations - Your opinions.. - Jon Kirwan - Jul 2 19:13:53 2009
On Thu, 02 Jul 2009 14:50:06 -0400, Walter wrote:
>Jon Kirwan wrote:
>
>> On Thu, 2 Jul 2009 18:19:30 +0100, you wrote:
>>
>> >My rule is : "ship what you test".
>> >
>>
>> Egads! How could there be any other option??? Do people actually
>> test with one compilation and then just recompile differently for
>> shipping and send out an untested one??? For real? Who would do
>> that?
>>
>Jon,
>
>This is such a big problem that we have kept very few optimization
>options in our compilers. This forces developers to ship the version
>they test and us to focus on a single optimization version of our
>tools.
>
>Walter..
Walter, you are scaring me. A lot. This is a big problem? Such that
you have had to make changes in the way you do business to help
mitigate it?
It's not difficult to make sure that what is tested is what will be
shipped and to provide multiple independent means by which others can
catch errors. This may include accessible status codes (where
commands or other visible means are available to the end user) to
provide an easy way to see exactly what compilation options (as well
as version) are running; MD5 codes on every file, binary or otherwise;
paper documentation for everything; etc.
I do think it is a good idea to use various optimization levels and do
internal testing to see how things fly (if it still fits.) It's a
good check (among many) to see that your code is soundly written. If
it works in one case and not in another, that's a strong indication
that you've got a weak point that will BITE HARD, someday, if not very
very soon. But one doesn't promulgate those copies anywhere near
where manufacturing might accidentally get hold of them and otherwise
mistake them as shippable. They should remain in tight control.
Jon
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re:IAR Optimizations - Your opinions.. - Ian Okey - Jul 3 4:31:20 2009
The idea that you could turn on optimisations just before shipping scares
the pants off me.
I have always shipped the image that has been through the testing cycle even
though this means that it is the debug build from the tools and does not
necessarily use the latest compiler and patch level. This build is created
with the functionality required for the final product and any residual test
interfaces are left in and hidden. I cannot throw away 3 weeks final test
and firmware run time.
Ian
2009/7/2 Richard (UK)
> My rule is : "ship what you test".
>
> Do NOT test an instrumented debuild build and then turn on the optimiser 10
> minutes before you ship.
>
> If this means shipping code which takes up a bit more space and CPU than
> the
> optimum, so be it.
>
> The cost of a product recall can destroy companies, so don't suddenly
> convert trusted & tested code into unknown code which you then give to
> customers!
> ----- Original Message -----
> From: Nick Loy
> To: 'm...@yahoogroups.com'
> Sent: Thursday, July 02, 2009 6:00 PM
> Subject: [msp430] Re:IAR Optimizations - Your opinions..
>
> My experience is mid grade optimization usually works fine, maximum
> optimization almost never works. Be absolutely sure all dynamic variables
> are declared as such.
>
> Nick Loy
> Principal Engineer
> Product Resources LLC
> 148 Sohier Rd
> Beverly MA 01915
> 978 524 8500
> (Home) 603 882 6664
> ------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re:IAR Optimizations - Your opinions.. - Anders Lindgren - Aug 3 4:59:37 2009
Nick Loy wrote:
> My experience is mid grade optimization usually works fine, maximum
> optimization almost never works. Be absolutely sure all dynamic
> variables are declared as such.
Hi Nick!
It's always great to get feedback on your products. However, it would be
even greater if you could be a bit more specific than "maximum
optimization almost never works". Do you have concrete cases when the
compiler doesn't generate correct code? If you do, I would be happy to
take a look at them.
-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )