Skip to content

ICE due to new bitfield algorithm (PR65742) #87227

@urnathan

Description

@urnathan

Sadly, #65742 (commit 49839f9) introduced a bug for a corner case of vbase placement:

struct __attribute__((aligned(4))) Empty {} empty;

struct Char { char a; } cbase;

struct D : virtual Char {
  [[no_unique_address]] Empty e0;
  [[no_unique_address]] Empty e1;
  unsigned a : 24; // keep as 24bits
} d;

in the complete D, the Char vbase is placed 3 bytes after the vptr (i.e. at offset 7 or 11), so the bitfield must remain 24-bits. We need dsize to limit the bitfield expansion, not nvsize. They're nearly always the same, except for cases like this involving multiple zero-sized members (or bases).

I will shortly be posting a patch to address this. (FWIW, I don't expect the triggering cases to be at all common).

Metadata

Metadata

Assignees

Labels

clang:codegenIR generation bugs: mangling, exceptions, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions