diff mbox series

[committed] Fix up pr51628-10.c testcase (PR target/88682)

Message ID 20190116142157.GU30353@tucnak
State New
Headers show
Series [committed] Fix up pr51628-10.c testcase (PR target/88682) | expand

Commit Message

Jakub Jelinek Jan. 16, 2019, 2:21 p.m. UTC
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.


	Jakub
diff mbox series

Patch

--- 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;