public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix up pr51628-10.c testcase (PR target/88682)
@ 2019-01-16 14:22 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2019-01-16 14:22 UTC (permalink / raw)
  To: gcc-patches

Hi!

This testcase violates aliasing and so is "miscompiled" e.g. on powerpc64
or aarch64 at -O2.  Fixed thusly, tested on powerpc64-linux, committed to
trunk as obvious.

2019-01-16  Jakub Jelinek  <jakub@redhat.com>

	PR c/51628
	PR target/88682
	* c-c++-common/pr51628-10.c (unaligned_int128_t): Add
	may_alias attribute.

--- gcc/testsuite/c-c++-common/pr51628-10.c.jj	2018-12-21 00:40:49.048937834 +0100
+++ gcc/testsuite/c-c++-common/pr51628-10.c	2019-01-16 15:15:51.515279138 +0100
@@ -11,7 +11,7 @@ struct pair_t
 typedef struct unaligned_int128_t_
 {
   __int128_t value;
-} __attribute__((packed)) unaligned_int128_t;
+} __attribute__((packed, may_alias)) unaligned_int128_t;
 
 struct pair_t p = {0, 1};
 unaligned_int128_t *addr = (unaligned_int128_t *) &p.i;

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-16 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 14:22 [committed] Fix up pr51628-10.c testcase (PR target/88682) Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).