Hide Forgot
GCC 4.8.5 fails the test case submitted in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78084. A slightly reduced test case is below. The unused hv variable, the unaligned test, and the vec_vsx_ld call in the call to f are all necessary in order to cause the micompilation. Code generated by GCC 7 runs successfully to completion. $ cat t.c && gcc -O1 -Wall -mvsx t.c && ./a.out #include <altivec.h> #define vec_u8_t vector unsigned char void __attribute__ ((noclone, noinline)) f (vec_u8_t v) { } static void __attribute__ ((noclone, noinline)) testcase (const unsigned char *dest) { vec_u8_t hv = vec_ld (0, dest); (void)&hv; vec_u8_t compare = vec_vsx_ld (0, dest); if ((unsigned long)dest & 15) __builtin_printf ("unaligned address %p\n", dest); f (vec_vsx_ld (0, dest)); if (!vec_all_eq (compare, vec_vsx_ld (0, dest))) __builtin_abort (); } const unsigned char __attribute__((aligned(16))) buf[] = { 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45, 46, 47 }; int main (void) { testcase (buf); testcase (buf + 8); return 0; } unaligned address 0x10000928 Aborted
The fix closest to GCC 4.8 that the upstream bug (72863) points to is: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=239762
The related test passes on ppc64le with gcc-4.8.5-14.el7. VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2094