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

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


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.


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