bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: test-stdalign failure on AIX


From: Paul Eggert
Subject: Re: test-stdalign failure on AIX
Date: Thu, 12 Dec 2019 10:31:37 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 12/11/19 6:43 PM, Bruno Haible wrote:
../../gltests/test-stdalign.c:94: assertion '(uintptr_t) &(static_char_Alignas) 
% TEST_ALIGNMENT == 0' failed
IOT/Abort trap (core dumped)

With xlclang 16.01, __attribute__ ((__aligned__ (N))) does not work on external variables; the attribute is ignored. Curious, since the attribute does work with plain xlc. Anyway, I installed the attached patch to work around the problem.

The following program illustrates the bug, which occurs with both _Alignas and __attribute__ ((__aligned__)). Perhaps if someone reading this knows how to file a bug report with IBM (I don't and couldn't easily find out), they could file a bug report against xlclang.

char _Alignas (8) c1, c2;
char __attribute__ ((__aligned__ (8))) c3, c4;

int
main (void)
{
  if ((unsigned long) &c1 % 8 != 0) return 1;
  if ((unsigned long) &c2 % 8 != 0) return 2;
  if ((unsigned long) &c3 % 8 != 0) return 3;
  if ((unsigned long) &c4 % 8 != 0) return 4;
  return 0;
}

Attachment: 0001-stdalign-port-to-xlclang-16.01.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]