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

Andy Trick atrick at apple.com
Mon Oct 25 14:47:18 PDT 2010


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? (gcc really should be smart enough to know this isn't a bug.)

-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





More information about the llvm-commits mailing list