https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120603
Bug ID: 120603
Summary: Improve addition/subtraction on RISC-V for out of
range constants
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: law at gcc dot gnu.org
Target Milestone: ---
Much like we've recently done for logical operations we should adjust the
additional and subtraction expanders to avoid constant synthesis and generate
efficient code during initial code generation.
This should avoid the need for the SUM_OF_TWO_S12 stuff that we added last
year. The work should also capture cases like this one:
long foo(long a) {
a -= 0x200000000;
return a;
}
Which should expand into a bseti+sub rather than synthesizing the negated
constant and using addition.