[llvm-commits] [llvm] r117199 - /llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp

Chandler Carruth chandlerc at gmail.com
Mon Oct 25 15:12:20 PDT 2010


On Mon, Oct 25, 2010 at 2:47 PM, Andy Trick <atrick at apple.com> wrote:

> This is the second time someone reported a warning that my build doesn't
> report. Of course, I want to keep the build warning-clean, but I'm not sure
> how to do better since the makefiles already set -Wall -pedantic (and
> several other -W's). Is this because I'm running a newer gcc (4.2.1) than
> linux developers?


Quite the opposite, 4.2.1 is much older than most Linux GCCs. GCC is on 4.4
now, and 4.5 isn't that far away.


> (gcc really should be smart enough to know this isn't a bug.)
>

The flow control may have been the same here, but in general it looked like
a bug. The only reason this wasn't a bug is because the string constant is
always true...


>
> -Andy
>
> On Oct 23, 2010, at 12:46 AM, Chandler Carruth wrote:
>
> > Author: chandlerc
> > Date: Sat Oct 23 02:46:14 2010
> > New Revision: 117199
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=117199&view=rev
> > Log:
> > Fix a likely bug in an assertion by adding parentheses around '||'. This
> bug
> > was found by a GCC warning. ;]
> >
> > Modified:
> >    llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp
> >
> > Modified: llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp?rev=117199&r1=117198&r2=117199&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp (original)
> > +++ llvm/trunk/lib/CodeGen/LiveIntervalUnion.cpp Sat Oct 23 02:46:14 2010
> > @@ -25,7 +25,7 @@
> >   // Add this live virtual register to the union
> >   LiveVirtRegs::iterator pos = std::upper_bound(lvrs_.begin(),
> lvrs_.end(),
> >                                                 &lvr,
> less_ptr<LiveInterval>());
> > -  assert(pos == lvrs_.end() || *pos != &lvr && "duplicate LVR
> insertion");
> > +  assert((pos == lvrs_.end() || *pos != &lvr) && "duplicate LVR
> insertion");
> >   lvrs_.insert(pos, &lvr);
> >   // Insert each of the virtual register's live segments into the map
> >   SegmentIter segPos = segments_.begin();
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
> _______________________________________________
> 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/20101025/b13014d2/attachment.html>


More information about the llvm-commits mailing list