This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/19597] [4.0 Regression] avr-gcc 4.0, multiplication by constant, very long code
- From: "roger at eyesopen dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2005 21:23:49 -0000
- Subject: [Bug target/19597] [4.0 Regression] avr-gcc 4.0, multiplication by constant, very long code
- References: <20050123225538.19597.dmixm@marine.febras.ru>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From roger at eyesopen dot com 2005-01-25 21:23 -------
I'm currently working on an updated and improved patch that should address
some of this size regression. Failing that there are a number of middle-end
improvements that can be made to address the code size increase. For example,
GCC's middle-end considers any constant with an rtx_cost greater than
COSTS_N_INSNS(1) to be expensive, and therefore worth keeping in a register
for CSE and GCSE. Unfortunately, this plays badly with AVR, where the cost
of a register-register copy is often greater than COSTS_N_INSNS(1)! The
solution to which is to introduce a REG_REG_MOVE_COST(mode) target macro that
can be used to report the cost of copying a pseudo and use this instead of
COSTS_N_INSNS(1) where appropriate. This should even help non-AVR platforms,
for example DImode typically requires two move instructions.
The change described above should avoid AVR keeping HImode integer constants
in registers and then copying them when required (its as cheap to load an
immediate constant as it is to copy registers, but the later increases register
pressure, stack frame size, etc...)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19597