This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] Fix bit/byte unit thinko in is_aliasing_offset
Geoff Keating wrote:
> This is supposed to behave the same way in GNU C; so you should make
> the testcase into a proper dejagnu testcase (by using abort() or
> exit(0))...
OK. A couple of questions, still. On at least x86-linux, the testcase adapted
as below compiles fine and aborts with or without the suggested patch, and it
appears the compiler does not even get into is_aligning_offset anyway. I also
presume that the maximum supported value for ALIGNMENT depends on the target.
How is this supposed to work in the compiler for C ?
How should we ensure ALIGNMENT is large enough and still not too large on
various targets ?
Thanks in advance for your help,
Olivier
#define ALIGNMENT 32
typedef int aligned_int __attribute__ ((aligned (ALIGNMENT)));
int
main (void)
{
aligned_int x;
if (((unsigned long) &x % ALIGNMENT) != 0)
abort ();
return 0;
}