https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103875
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Component|middle-end |ipa
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Last reconfirmed| |2021-12-31
CC| |marxin at gcc dot gnu.org
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The inliner removes the clobber in this case it seems:
We have:
void foo::pop (struct foo * const this)
{
long unsigned int _1;
long unsigned int _2;
long unsigned int _3;
value_type * _4;
<bb 2> :
_1 = this_6(D)->size;
_2 = _1 + 18446744073709551615;
this_6(D)->size = _2;
_3 = this_6(D)->size;
_4 = &this_6(D)->data[_3];
*_4 ={v} {CLOBBER};
return;
}
void use_foo (struct foo & f)
{
int _1;
int _2;
value_type & _6;
<bb 2> :
_6 = foo::back (f_4(D));
_1 = *_6;
_2 = _1 * 42;
*_6 = _2;
foo::pop (f_4(D));
return;
}
And then foo::pop (and back) gets inlined we get:
void use_foo (struct foo & f)
{
value_type & D.2143;
int _1;
int _2;
long unsigned int _5;
value_type & _6;
long unsigned int _9;
long unsigned int _10;
long unsigned int _11;
value_type & _12;
value_type & _13;
<bb 2> :
_10 = f_4(D)->size;
_11 = _10 + 18446744073709551615;
_12 = &f_4(D)->data[_11];
_13 = _12;
_6 = _13;
_1 = *_6;
_2 = _1 * 42;
*_6 = _2;
_5 = f_4(D)->size;
_9 = _5 + 18446744073709551615;
f_4(D)->size = _9;
return;
}