This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/79408] New: Missed VRP optimization of integer modulo
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Feb 2017 15:29:00 +0000
- Subject: [Bug tree-optimization/79408] New: Missed VRP optimization of integer modulo
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79408
Bug ID: 79408
Summary: Missed VRP optimization of integer modulo
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
While looking at PR79388, I've noticed that while VRP optimizes well integer
modulo if say first operand is [0, 133] and second operand 134, we don't do the
same if second operand is [134, 237] or [134, +INF].
Testcase:
unsigned int
foo (unsigned int x, unsigned int y)
{
if (x > 7312)
return 7;
if (y <= 7312)
return 12;
return x % y;
}
int
bar (int x, int y)
{
if (x > 7312 || x < 0)
return 8;
if (y <= 7312)
return 13;
return x % y;
}
int
baz (int x, int y)
{
if (x > 7312 || x < -7312)
return 9;
if (y <= 7312)
return 14;
return x % y;
}