This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] 69780 - [4.9/5/6 Regression] ICE on __builtin_alloca_with_align, with small alignment
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: "Dominique d'Humières" <dominiq at lps dot ens dot fr>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 Feb 2016 15:46:57 +0100
- Subject: Re: [PATCH] 69780 - [4.9/5/6 Regression] ICE on __builtin_alloca_with_align, with small alignment
- Authentication-results: sourceware.org; auth=none
- References: <F0F3339F-889C-4C15-B226-269E19993664 at lps dot ens dot fr> <56CDC044 dot 4090901 at gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 24, 2016 at 07:37:56AM -0700, Martin Sebor wrote:
> On 02/24/2016 03:12 AM, Dominique d'Humières wrote:
> >The test gcc.dg/builtins-68.c fails on x86_64-apple-darwin15:
>
> Thanks for the heads up. I see it also fails on i686-pc-linux-gnu
> and likely other 32-bit targets for similar reasons. Let me adjust
> it today.
The last argument is size_t, which is unsigned int on some targets, unsigned
long on others, unsigned long long on others.
Thus perpaps you want to turn those
p = __builtin_alloca_with_align (n, LONG_MAX); /* { dg-error "must be a constant integer" } */
p = __builtin_alloca_with_align (n, ~0LU); /* { dg-error "must be a constant integer" } */
p = __builtin_alloca_with_align (n, 1LLU << 34); /* { dg-error "must be a constant integer" } */
p = __builtin_alloca_with_align (n, LLONG_MAX); /* { dg-error "must be a constant integer" } */
p = __builtin_alloca_with_align (n, ~0LLU); /* { dg-error "must be a constant integer" } */
tests into
... (n, (size_t) (sizeof (size_t) >= sizeof (long) ? LONG_MAX : 0))
and similarly for the others?
I.e. if size_t is big enough, test it, otherwise still generate the error, but for some other reason?
Jakub