[En-Nut-Discussion] GCC optimizations

Thiago A. Corrêa thiago.correa at gmail.com
Mon Mar 16 17:22:44 CET 2009


Hi,

On Mon, Mar 16, 2009 at 12:52 PM, Coleman Brumley
<cbrumley at polarsoft.biz> wrote:
>> I think the backend is responsible for most optimizations, so this
>> could really be arm specific.
>
> I'm not sure what you mean by the "backend is responsible...".  I'm certain
> this is specific to the ARM7 code, and I have no way of testing on an AVR,
> unfortunately.

Compilers usually have a front end, responsible for parsing the text
sources into a tree, that represents that code. Then the back end
takes that tree and generates the machine code. In GCC this is very
clearly separated AFAIK, with a single front end and many backends,
for each one of the supported targets.

>> What strange behavior are you seeing?
>
> I'm seeing very strange things, like the generation of prefetch aborts and
> data aborts when optimization is turned off.  When optimization is enabled
> (-Os), then these aborts don't happen.  Unfortunately, sometime, it's vice
> versa.

Harald answered this better than I could :)

>> >
>> > I'm using gcc v4.2.2 and binutils 2.18 in YAGARTO.
>> >
>>
>> Same here, but for AVR32. Works ok *most* of the time. Since AVR32
>> toolchain is quite new, it has quite a number of bugs still. Of
>> course, they are quite AVR32 specific. Sometimes I even get internal
>> compiler errors, but they go away after a retry.
>
> That's troubling news.  Do you feel this is something specific to YAGARTO?
> Perhaps I should try a different ARM7 cross compiler to see if I get
> different results?  Would the gcc built for Linux work any differently?

I'm sorry, that was just as an example of backend specific bugs. It
doesn't imply anything about YAGARTO, actually.

AFAIK, that is the recommended toolchain build for Nut/OS. The WinARM
seems to have some problems. I've seen that most arm users here say
they use that one.

> I'm not sure how to even verify that would be the case or not.  I didn't
> want to have to dig through assembly, but...

If you want, you could take a look at WinARM. But as I said, ppl have
reported to have problems with that while yagarto worked fine for
them.

Kind Regards,
   Thiago A. Correa



More information about the En-Nut-Discussion mailing list