[Top][All Lists]

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

RE: [avr-gcc-list] Missed optimisations when manipulating bytes

From: Eric Weddington
Subject: RE: [avr-gcc-list] Missed optimisations when manipulating bytes
Date: Thu, 04 Oct 2007 15:03:08 -0600

> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of David Brown
> Sent: Thursday, October 04, 2007 8:35 AM
> To: 'AVR-GCC'
> Subject: [avr-gcc-list] Missed optimisations when manipulating bytes
> I was looking at the assembly generated from a program I'm
> working on,
> and it strikes me that there is a lot of scope for improvement in the
> register manipulation when mixing bytes and 16-bit words like in the
> code below.  I've only tested using the latest winavr release (gcc
> 4.1.2), so maybe newer versions are better.

Hi David,

GCC 4.2.x and 4.3 (unreleased, currently HEAD) may only be marginally better
based on what I've seen with some limited test cases.

It's somewhat known (at least by those who work closely with the toolchain)
about these issues with optimization. Like all open source projects, we
could always do with more volunteers to help.

Here is the known bug list for the AVR toolchain:
This lists all known bugs for binutils, gcc, gdb, with links to the
individual bug reports, and links to bug lists for other projects: avr-libc,
avrdude, avarice.

There are higher priority GCC bugs that *really* need to get fixed before
missed optimizations can even begin to be looked at, such as:

A regression for 4.1/4.2/4.3. Causes Internal Compiler Error (ICE) on valid

A regression for 4.1/4.2/4.3. Causes Internal Compiler Error (ICE) on valid

Regression on 4.2/4.3. Too much RAM used: __clz_tab[] linked.

AVR: wrong code generated when passing three uint64_t arguments to function.

Call through function pointer goes to wrong address. Wrong code generated.

Internal compiler error in gen_rtx_SUBREG.

[avr] can't find a register in class 'BASE_POINTER_REGS' while reloading

And there are other bugs that generate wrong-code too. Some of those are for
C++ and since there are not that many users of C++, it is doubtful when they
will get fixed. There are also many "missed optimization" bugs already
listed there.

Even if one cannot help fix these bugs, it is very helpful to go through the
bug list and try to confirm if the bug still exists, which version of the
compiler it works on and doesn't work on, etc. I've been doing a bit of this
myself lately. Of course, in doing this, it is helpful if you are able to
build the toolchain so you can build the latest snapshot and try it out with
these bugs.

So while I deeply appreciate anyone helping to take a look at what can be
improved with optimizations for the AVR target, to really improve the
quality of AVR GCC, we need to fix these bugs that produce wrong code, or
causes an internal compiler error on valid code.

And specifically, I need to get GCC bug #29524 (above) fixed before I
release the next WinAVR with GCC 4.2.2. That bug has been analyzed; we just
need a fix for it that will be able to be contributed back to GCC and will
fit with the rest of the system.

Eric Weddington

reply via email to

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