This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35056] [4.3 Regression] ICE in copy_to_mode_reg, at explow.c:621
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Feb 2008 15:57:38 -0000
- Subject: [Bug middle-end/35056] [4.3 Regression] ICE in copy_to_mode_reg, at explow.c:621
- References: <bug-35056-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenther at suse dot de 2008-02-02 15:57 -------
Subject: Re: [4.3 Regression] ICE in copy_to_mode_reg,
at explow.c:621
On Sat, 2 Feb 2008, matz at gcc dot gnu dot org wrote:
> ------- Comment #3 from matz at gcc dot gnu dot org 2008-02-02 15:52 -------
> Reduced by hand:
>
> % cat x.cc
> enum EBorderStyle { bla = 1 };
> template<typename T, typename U>
> inline bool compareEqual(const T& t, const U& u)
> {
> return t == u;
> }
> struct S {
> unsigned m_style : 4;
> };
>
> void call (S *s, EBorderStyle v)
> {
> if (!compareEqual(s->m_style, v))
> s->m_style = v;
> }
>
> The problem is confusion between the bitmap type and promotion. If you
> rewrite the compare into a direct expression ("if (s->m_style != v) ...")
> the error doesn't occur. Anyway, as written this get's generated as
> (004.gimple):
>
> <unnamed-unsigned:4> D.1670;
> unsigned char D.1673;
> unsigned int D.1668;
>
> D.1670 = s->m_style;
> D.1668 = D.1670;
This is missing a conversion, type checking would complain.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35056