This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/60001] New: VRP fails to fold identical unsigned comparisons


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]