[llvm] r214671 - CodeGen: silence a warning

Richard Trieu rtrieu at google.com
Mon Aug 4 14:59:27 PDT 2014


I filed http://llvm.org/bugs/show_bug.cgi?id=20536 for this.  Short story,
macros.


On Mon, Aug 4, 2014 at 9:39 AM, David Blaikie <dblaikie at gmail.com> wrote:

> Any idea if this warning showed up with Clang too?
>
> Richard - any idea why (if not) this doesn't show up with Clang?
>
> On Sun, Aug 3, 2014 at 4:00 PM, Saleem Abdulrasool
> <compnerd at compnerd.org> wrote:
> > Author: compnerd
> > Date: Sun Aug  3 18:00:38 2014
> > New Revision: 214671
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=214671&view=rev
> > Log:
> > CodeGen: silence a warning
> >
> > GCC 4.8.2 objects to the tautological condition in the assert as the
> unsigned
> > value is guaranteed to be >= 0.  Simplify the assertion by dropping the
> > tautological condition.
> >
> > Modified:
> >     llvm/trunk/lib/CodeGen/MachineCombiner.cpp
> >
> > Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=214671&r1=214670&r2=214671&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Sun Aug  3 18:00:38 2014
> > @@ -144,8 +144,7 @@ MachineCombiner::getDepth(SmallVectorImp
> >            InstrIdxForVirtReg.find(MO.getReg());
> >        if (II != InstrIdxForVirtReg.end()) {
> >          // Operand is new virtual register not in trace
> > -        assert(II->second >= 0 && II->second < InstrDepth.size() &&
> > -               "Bad Index");
> > +        assert(II->second < InstrDepth.size() && "Bad Index");
> >          MachineInstr *DefInstr = InsInstrs[II->second];
> >          assert(DefInstr &&
> >                 "There must be a definition for a new virtual register");
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140804/37086d54/attachment.html>


More information about the llvm-commits mailing list