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

--- Comment #17 from Nathan Froyd <froydnj at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #15)
> Instead aligned the string.

This is kind of unfortunate, as the motivating testcase was something more
like:

...
  static const char string[] = "Private";
  unsigned int priv, riva, ivat, vate;
  memcpy(&priv, &string[0], sizeof(priv));
  memcpy(&riva, &string[1], sizeof(riva))
  memcpy(&ivat, &string[2], sizeof(ivat));
  memcpy(&vate, &string[3], sizeof(vate));
  /* proceed to use priv, riva, ivate, vate for comparisons */

So on strict-align targets, even if the source string was aligned (and that has
to be by user-declaration?) we wouldn't catch the latter three?

Reply via email to