This is the mail archive of the gcc@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]

Re: h8300-elf build broken


On Wed, 9 May 2012, Richard Guenther wrote:

On Wed, May 9, 2012 at 1:24 AM, Gabriel Dos Reis
<gdr@integrable-solutions.net> wrote:
On Tue, May 8, 2012 at 5:14 PM, DJ Delorie <dj@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 agree that the ICE should be fixed, but sadly the patch will still be necessary because of platforms where size_t is unsigned short (I didn't know those existed...) and because std::max is picky about having the same type for both arguments (the papers about improving it for C++11 were rejected).


--
Marc Glisse


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