https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113478
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #2) > Probably is_inexpensive_bulitin_p should return true here? Possibly, at least when we know it doesn't expand to a libatomic call? OTOH even then a function just wrapping such call should probably be inlined, so the question is whether the problem that _3 = &MEM[(const struct __atomic_base *)this_1(D)]._M_i; freq:1.00 size: 0 time: 0 _4 = __atomic_load_1 (_3, 0); freq:1.00 size: 4 time: 13 _5 = (char) _4; freq:1.00 size: 0 time: 0 return _5; freq:1.00 size: 1 time: 2 is estimated as too big compared to the call calling the function (OTOH a1.test () has no arguments while __atomic_load_1 has two).