This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54810] VRP doesn't handle comparison of narrowing cast like comparison of BIT_AND_EXPR
- 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: Fri, 05 Oct 2012 09:37:32 +0000
- Subject: [Bug tree-optimization/54810] VRP doesn't handle comparison of narrowing cast like comparison of BIT_AND_EXPR
- Auto-submitted: auto-generated
- References: <bug-54810-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54810
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-05 09:37:32 UTC ---
Author: jakub
Date: Fri Oct 5 09:37:25 2012
New Revision: 192115
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192115
Log:
PR tree-optimization/54810
* tree-vrp.c (register_edge_assert_for_2): Handle
NAME = (unsigned) NAME2; if (NAME cmp CST) for
narrowing casts to unsigned integral type like
NAME = NAME2 & CST2; if (NAME cmp CST) where CST2
is the max value of the unsigned integral type.
* gcc.dg/tree-ssa/vrp85.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp85.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c