This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] 69780 - [4.9/5/6 Regression] ICE on __builtin_alloca_with_align, with small alignment


On 02/24/2016 07:46 AM, Jakub Jelinek wrote:
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?

Yes, something like that, thanks.  Some of the tests are redundant
given the builtin's signature and only there out of paranoia. They
can be removed.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]