[Bug middle-end/104588] memset loses alignment infomation in some cases

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 18 05:38:33 GMT 2022


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |middle-end
   Last reconfirmed|                            |2022-02-18
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
            Summary|user-defined constructor    |memset loses alignment
                   |loses alignment information |infomation in some cases
                   |about `*this`               |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed,
Reduced testcase:
struct alignas(16) foo
{
  unsigned char a[32];
};

foo* construct(foo* p)
{
  __builtin_memset(p, 0, sizeof(foo));
  return p;
}

----- CUT ----
That is it has nothing to do with the constructors at all but just memset.


More information about the Gcc-bugs mailing list