This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84525] GCC7: generate movaps instruction when assign to unaligned __int128*
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Feb 2018 07:53:22 +0000
- Subject: [Bug c++/84525] GCC7: generate movaps instruction when assign to unaligned __int128*
- Auto-submitted: auto-generated
- References: <bug-84525-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84525
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That testcase is invalid C, -fsanitize=undefined would even tell you.
__int128 requires 16-byte alignment and you're violating that.
You can use __int128 temp; memcpy (&temp, abc, sizeof (temp)); ... use temp ...
or __int128 in a __attribute__((packed)) structure etc. to read unaligned
objects.