https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101326
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-07-05
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Take:
struct g {
unsigned long b;
};
struct a
{
struct g g1;
unsigned char c;
};
static inline void h(struct g *a)
{
a->b = 0;
}
static inline void j(struct a *a)
{
h(&a->g1);
a->c = 1;
}
struct a f(void)
{
struct a a;
j(&a);
return a;
}
---- CUT ----
It works, I suspect in the case of std::optional, std::optional is marked as
BLKmode rather than TImode as the struct is marked as "ADDRESSABLE".