This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/37939] New: [4.2/4.3/4.4 Regression] CRIS port: no addi insn
- From: "hp at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2008 16:50:46 -0000
- Subject: [Bug target/37939] New: [4.2/4.3/4.4 Regression] CRIS port: no addi insn
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The CRIS port no longer emits an addi insn for (a << N) + b, where N = {1, 2}.
Trivial test-case:
/* Make sure ADDI is combined and emitted successfully.
See also PRXXXXX. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler "addi" } } */
/* { dg-final { scan-assembler-not "lsl" } } */
int xyzzy (int r10, int r11)
{
return r11 * 4 + r10;
}
This insn was created and emitted for e.g. 3.2.1
A look at the combine dump shows that the cost for the individual insns is 5
for the shift (the constant counts as 1 as per cris_rtx_costs) and 4 for the
add. However, the combined cost is 10, also as per cris_rtx_costs, because the
insn is (perhaps wrongly) specified as (plus (mult 4 reg1) reg2) and the MULT
cost is 6 as per cris_rtx_costs and the PLUS counts as 4.
The way the target address cost function is called has changed, and
cris_address_cost needs adjustment. Actually, it needs a rewrite, but an
adjustment will do for the 4.3 and 4.4/trunk, being in stage 3.
Patch in progress.
--
Summary: [4.2/4.3/4.4 Regression] CRIS port: no addi insn
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hp at gcc dot gnu dot org
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: cris-*-* and crisv32-*-*
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37939