[Bug c++/106502] Three calls to __attribute__((const)) function

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 1 23:11:37 GMT 2022


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
As you can see by the gimplification:
  _1 = std::_V2::system_category ();
  _2 = std::_V2::system_category ();
  _3 = _2->_vptr.error_category;
  _4 = _3 + 16;
  _5 = *_4;
  _6 = std::_V2::system_category ();
  _7 = OBJ_TYPE_REF(_5;(const struct error_category)_1->2B) (_6);


More information about the Gcc-bugs mailing list