This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/60001] New: VRP fails to fold identical unsigned comparisons
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 30 Jan 2014 22:07:46 +0000
- Subject: [Bug tree-optimization/60001] New: VRP fails to fold identical unsigned comparisons
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60001
Bug ID: 60001
Summary: VRP fails to fold identical unsigned comparisons
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: glisse at gcc dot gnu.org
void f(unsigned p,unsigned q){
if(p>=q) throw 42;
if(p>=q) throw 33;
}
VRP fails to eliminate the redundant comparison, only DOM manages to do it.
Since VRP manages with either s/unsigned/int/ or s/>=/>/, I assume it should be
doable.
(in practice, p is an index, q the size of an array, and I wish using unsigned
for anything but bitops and modular arithmetic could be banned)