This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/79408] 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: Wed, 08 Feb 2017 09:22:29 +0000
- Subject: [Bug tree-optimization/79408] Missed VRP optimization of integer modulo
- Auto-submitted: auto-generated
- References: <bug-79408-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79408
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Feb 8 09:21:57 2017
New Revision: 245273
URL: https://gcc.gnu.org/viewcvs?rev=245273&root=gcc&view=rev
Log:
PR tree-optimization/79408
* tree-vrp.c (simplify_div_or_mod_using_ranges): If op1 is not
constant, but SSA_NAME with a known integer range, use the minimum
of that range instead of op1 to determine if modulo can be replaced
with its first operand.
* gcc.dg/tree-ssa/pr79408.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr79408.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c