Consider the following code: int divmod(int a, int b) { int q = a / b; int r = a % b; return q + r; }
For an ARM EABI target, this results in one __aeabi_idivmod() call and one __aeabi_idiv() call even though the former already calculates the quotient. -- Summary: Failure to optimise (a/b) and (a%b) into single __aeabi_idivmod call Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mans at mansr dot com GCC build triplet: x86_64-pc-linux-gnu GCC host triplet: x86_64-pc-linux-gnu GCC target triplet: arm-unknown-linux-gnueabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721