[Bug tree-optimization/102586] [12 Regression] ICE in clear_padding_type, at gimple-fold.c:4798 since r12-3433-ga25e0b5e6ac8a77a

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 10 22:34:51 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102586

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
With the C7/C8 case, it is actually not just about clearing too much, but
clearing different bits:
struct C0 {};
struct C1 {};
struct C2 : C1, virtual C0 {};
struct C3 : virtual C2, C1 {};
struct C6 { char c; };
struct C7 : virtual C6, virtual C3, C1 {};
struct C8 : C7 {};

__attribute__((noipa)) void
foo (C8 *q)
{
  __builtin_clear_padding (q);
}

__attribute__((noipa)) void
bar (C7 *q)
{
  __builtin_clear_padding (q);
}

void
baz ()
{
  C8 c8;
  foo (&c8);
  bar (&c8);
}
will clear in one case the padding byte at offset 8, in the other case will
keep that unchanged and will clear the byte after it.


More information about the Gcc-bugs mailing list