mipsisa64-elf-gcc -S -O2 gcc.target/mips/madd-7.c -DNOMIPS16= does not produce the expected MADD. On long64 ABIs like EABI64, the loop starts out with an extra extendsidi2 instruction, and although this instruction gets removed after reload by a "split to nothing", it is still around at register allocation time.
extendsidi2 does not allow LO operands, so its presence discourages the register allocator from using LO for the accumulator. The fix is to add a LO alternative to extendsidi2. I'm filing this for 4.5 or later; it isn't something we'd fix in 4,4 or earlier. -- Summary: MIPS extendsidi2 does not have a LO alternative Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rsandifo at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38598