[Bug c++/89458] adding aligned attribute to struct causes too much to be copied

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 26 08:42:00 GMT 2019


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-02-26
                 CC|                            |jason at gcc dot gnu.org
          Component|other                       |c++
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that sizeof(Obj) is 256.  But yes, the padding at the end of the
object need not be copied.  Thus this is a missed optimization (I'm not sure we
actually store the "original" size anywhere though).  Maybe the FE could
use the classtype-as-base type here?


More information about the Gcc-bugs mailing list