[Bug c++/57793] [4.7/4.8/4.9 Regression] ICE with bitfields in get_bit_range

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 4 07:51:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57793

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |ice-on-invalid-code
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
struct A { bool a : 1; bool b : 1; };
struct B
{
  unsigned char c[0x40000000];
  unsigned char d[0x40000ff0];
  A e;
  void *foo ()
  {
    if (e.a)
      return (void *) 0;
    e.b = true;
    return c;
  }
};
void
bar (B *p)
{
  p->foo ();
}

This is of course invalid for 32-bit arches, you can't have an aggregate larger
than half of the address space, so this PR is just about missing diagnostics
for it.  If the single field is 0x80000000U bytes or larger, gcc already
diagnoses it.



More information about the Gcc-bugs mailing list