This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] avoid alignment error for attribute warn_if_not_aligned
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Dec 2017 09:22:25 +0100
- Subject: Re: [PATCH] avoid alignment error for attribute warn_if_not_aligned
- Authentication-results: sourceware.org; auth=none
- References: <cc2fc413-52e8-bce7-40ae-cff7214c7269@gmail.com>
On Tue, Dec 12, 2017 at 1:57 AM, Martin Sebor <msebor@gmail.com> wrote:
> My enhancement to improve the detection of attribute collisions
> introduced a regression of sorts in the g++.dg/pr53037-4.C test
> on ia64.
>
> https://gcc.gnu.org/ml/gcc-testresults/2017-12/msg00672.html
>
> The regression hasn't been noticed anywhere else only because
> all the other targets apparently have no low limit on function
> alignment, whereas ia64 has a limit of 32. As a result of
> the limit the i64 compiler would issue not one but two errors
> for a function declaration with attribute warn_if_not_aligned
> that specifies a value less than 32:
> one for the attribute itself (because it's not allowed on
> functions),
> and another for the lower value.
>
> The attached patch fixes this by issuing the error only for
> attribute aligned with a lower requirement but not attribute
> warn_if_not_aligned.
>
> I tried to come up with a test for this that would fail on
> other targets besides ia64 (those with no low bound on
> function alignment) but couldn't find a way to do it. If
> someone knows of a way I'd be glad to add a better test
> than pr53037-4.C.
Ok.
Richard.
> Martin