https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96963
Pokechu22 <pokechu022+gccbugzilla at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pokechu022+gccbugzilla@gmai
| |l.com
--- Comment #16 from Pokechu22 <pokechu022+gccbugzilla at gmail dot com> ---
I ran into this with Dolphin Emulator (see
https://github.com/dolphin-emu/dolphin/pull/11534), but ran into trouble trying
to simplify it. Here's what I ended up with:
```
struct Foo {
char pad[40];
char a, b;
};
struct Bar {
void Baz();
// One of these needs to be uncommented for the issue to occur
// virtual void Qux();
// int x;
Foo foo;
};
void heh(char *);
void Bar::Baz() {
heh(&foo.a);
foo.a = 1;
foo.b = 1;
}
```
Based on Godbolt (https://godbolt.org/z/46aTrP3vj) I can confirm that this
doesn't happen in 11.0 or 9.3/9.5, and does happen on 10.1/10.2/10.3/10.4.