This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] correct maximum valid alignment in error message (PR 89812)
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jeff Law <law at redhat dot com>, Martin Sebor <msebor at gmail dot com>, "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Mar 2019 23:49:49 +0100
- Subject: Re: [PATCH] correct maximum valid alignment in error message (PR 89812)
- References: <91b01cb1-b0e5-f39b-a437-16252f421253@gmail.com> <4276945d-6579-7b3e-e5e5-06721a3670ad@redhat.com> <20190326152940.GD7611@tucnak>
Hi Jakub,
> On Mon, Mar 25, 2019 at 11:41:35AM -0600, Jeff Law wrote:
>> > PR c/89812 - incorrect maximum in error: requested alignment
>> > ‘536870912’ exceeds maximum 2147483648
>> >
>> > gcc/c-family/ChangeLog:
>> >
>> > PR c/89812
>> > * c-common.c (check_user_alignment): Rename local. Correct maximum
>> > alignment in diagnostic. Avoid assuming argument fits in SHWI,
>> > convert it to UHWI when it fits.
>> >
>> > gcc/testsuite/ChangeLog:
>> >
>> > PR c/89812
>> > * gcc.dg/attr-aligned-3.c: New test.
>> OK
>
> The test FAILs on all 32-bit targets (where __UINT64_TYPE__ is unsigned long
> long) due to -pedantic-errors, and I bet will fail on all non-ELF targets on
> AVR, because only config/elfos.h defines 1 << 28 as MAX_OFILE_ALIGNMENT (in
> bytes) and the test relies on exactly that value, nothing else.
>
> Fixed thusly, tested on x86_64-linux (-m32/-m64), ok for trunk?
>
> If we have some elf targets that still don't use elfos.h, we might need to
> add them next to avr too.
FWIW, adding *-*-solaris2.* to the target list lets the test also PASS
on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (32 and 64-bit each).
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University