On Wed, May 9, 2012 at 3:27 AM, Richard Guenther <richard.guent...@gmail.com> wrote: > On Wed, May 9, 2012 at 1:24 AM, Gabriel Dos Reis > <g...@integrable-solutions.net> wrote: >> On Tue, May 8, 2012 at 5:14 PM, DJ Delorie <d...@redhat.com> wrote: >>> >>> I assume this is a size_t vs int type problem, but the diagnostic >>> points to the function declaration, not to an actual binary >>> expression, and I can't figure out what it's complaining about: >> >> My mailer uses proportional fonts so I can't make sense of the >> diagnostics with the carets :-/ >> >>> >>> Note: my current patchset is: >>> >>> Index: libstdc++-v3/include/std/bitset >>> =================================================================== >>> --- libstdc++-v3/include/std/bitset (revision 186562) >>> +++ libstdc++-v3/include/std/bitset (working copy) >>> @@ -1374,13 +1374,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER >>> void >>> bitset<_Nb>:: >>> _M_copy_from_ptr(const _CharT* __s, size_t __len, >>> size_t __pos, size_t __n, _CharT __zero, _CharT __one) >>> { >>> reset(); >>> - const size_t __nbits = std::min(_Nb, std::min(__n, __len - __pos)); >>> + const size_t __nbits = std::min(_Nb, std::min(__n, (size_t)(__len - >>> __pos))); >> >> style nits: It should be size_t(__len - __pos), and not (size_t)(__len - >> __pos). >> Same for the other hunk. Patch OK with those changes. > > This looks like a middle-end ICE that is at most worked around by the above > change. So I don't believe we should paper over it like this during stage1.
I do agree we should not be papering over bugs in the compiler at this stage. On the other hand, std::min takes arguments of the same type; all the above is doing is to make sure that we do call with size_t args. So, whether the middle-end bug is fixed or not, the change is still sound and good to apply. -- Gaby