[Bug tree-optimization/85726] New: div C1 to div C2 match.pd suboptimization
hp at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 9 23:32:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85726
Bug ID: 85726
Summary: div C1 to div C2 match.pd suboptimization
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: hp at gcc dot gnu.org
Target Milestone: ---
See the attached test-case, ready to drop into testsuite/gcc.dg.
The suboptimization results in separate div and mod sequences
across all architectures where division or modulus by a constant
is implemented as a widened multiplication and right-shift
(actually most; at least x86_64, mips, ppc, aarch64). The
test-case doesn't fail for e.g. sparc, that doesn't do it that
way.
This is a somewhat long-standing suboptimality, but a regression.
The title hints at the cause and solution; patch to be posted.
More information about the Gcc-bugs
mailing list