avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] Can't Install avr-gcc in FreeBSD


From: David Brown
Subject: Re: [avr-chat] Can't Install avr-gcc in FreeBSD
Date: Wed, 22 Aug 2007 09:09:03 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Joerg Wunsch wrote:
David Brown <address@hidden> wrote:

You don't need to convince me - I've seen plenty of horror stories
of this type, both myself and with my customers (although not with
IAR - I have never bought a compiler from them).

Even though we got IAR for free at work, well, free of charge at least
-- I never use it.  It's a pain in the bottom to convince that
compiler that there's a valid license, and it's virtually impossible
to convince it there's a valid network license when the compiler run
within a VMware machine.  After spending many hours with IAR support
about that, sending them detailed reports about all the history track
record back to at least year 1900, they eventually offered me that
running it within a virtual machine is not supported, and won't be.
As I, in turn, don't want to sit in front of a Windows machine, and
IAR doesn't want to support anything else but Windows -- there's now
zero motivation for me to even use it at all.  That's even though I'm
convinced they are better in some details than GCC, at least for the
AVR target.

Some c.a.e. regulars seem to believe that commercial compilers
regularly produce smaller and tighter code than gcc because they are
x years ahead in terms of optimisations.

It was kinda funny.  Occasionally, some people complain about certain
GCC optimizations being too aggressive, in particular in the
German-language mikrocontroller.net forums.  A couple of times, I've
got curious enough to find an instance of IAR I could really get
access to, and compare the results from both compilers for the same
code.  Guess what?  In all analyzed cases, IAR performed almost the
same kind of optimizations as those people complained about on GCC.  I
thought this to be really impressive: both compilers have a completely
different code base, grew out of a completely different history, yet
produce similar optimization techniques, almost down to the code
sequences involved.  (IAR and GCC use different ABIs on AVR, so of
course, different actual CPU registers are used.)


There are always people who don't understand the nature of optimisations. I also use ImageCraft's icc-avr compiler (I started with it before avr-gcc was good enough for serious work, and I did not want to go with IAR). The compiler is not really what you'd call an "optimising compiler" (although newer versions are a bit better - ImageCraft see their strengths in easy to use, small and light tools with good support, rather than top quality code generation). But on the mailing list there are regular discussions with people complaining about the compiler "doing things behind my back", and who flat out disbelieve the compiler should be allowed to remove unused code or data.

Back to gcc and other compilers - there is one area where gcc lags many of the big names in commercial compilation. Code generation is often fairly similar (I've compared some from the ColdFire port with a large commercial compiler used by a customer, for example), but what is lacking is proper link time optimisation. I understand that this is an ongoing project at gcc, and has been for a few years, but it is not yet in place. -fwhole-program and --combine should be able to give you many of the same effects, although they are only suitable for smaller projects and only work in C, but I don't know how well they work in practice (I haven't tried them myself). I certainly look forward to good, stable link time optimisations - it would make well structured code, especially for C++, much more efficient (you would no longer need to choose between inlined functions in headers for good code size, or in the implementation files for good structure).

mvh.,

David




reply via email to

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