make -k check-gcc RUNTESTFLAGS=dg.exp=c-c++-common/pr51628-10.c FAIL: c-c++-common/pr51628-10.c -Wc++-compat execution test FAIL: c-c++-common/pr51628-10.c -std=gnu++98 execution test FAIL: c-c++-common/pr51628-10.c -std=gnu++14 execution test FAIL: c-c++-common/pr51628-10.c -std=gnu++17 execution test # of expected passes 1 # of expected passes 3 # of unexpected failures 1 # of unexpected failures 3 The test case is exiting with a non-zero return code when it fails.
It looks like that powerpc64 failed to properly handle packed __int128_t.
aarch64 may have the same issue.
Indeed, the test also fails on aarch64-linux-gnu
Confirmed based on the latest test results for both targets: https://gcc.gnu.org/ml/gcc-testresults/2019-01/msg01230.html https://gcc.gnu.org/ml/gcc-testresults/2019-01/msg01245.html
It looks like this test is violating strict aliasing. If I compile with -fno-strict-aliasing then it works. I think pointing p.i (type __int128_t) to something of type unaligned_int128_t is a standards violation in C or C++ but I am not a language lawyer. FYI: I get the same behavior with C or C++ on aarch64. It works with -O1 on aarch64 but fails with -O2 and the difference is the ordering of loads and stores.
Yes this does violate aliasing rules. Easy fix is to add may_alias to the attributes of unaligned_int128_t.
Patch to do so is preapproved.
Author: jakub Date: Wed Jan 16 14:18:47 2019 New Revision: 267970 URL: https://gcc.gnu.org/viewcvs?rev=267970&root=gcc&view=rev Log: PR c/51628 PR target/88682 * c-c++-common/pr51628-10.c (unaligned_int128_t): Add may_alias attribute. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/c-c++-common/pr51628-10.c
Fixed.