This is the mail archive of the 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] Fold __builtin_constant_p immediately when in the first argument of __builtin_choose_expr (PR c/19449)

On Tue, 2 Apr 2013, Jakub Jelinek wrote:

> The following patch folds it there immediately too.  Bootstrapped/regtested
> on x86_64-linux and i686-linux, ok for trunk?


> BTW, in the PR I've also mentioned what has been reported to the Red Hat
> bugzilla about __builtin_constant_p in array bounds of static (or extern)
> arrays in block contexts.  Those can't be VLAs, so we want to know the
> constant bound, but if __builtin_constant_p is used there, we error on it
> (while at file scope it compiles fine, because if cfun is NULL, we fold
> __builtin_constant_p immediately).  Any suggestions how to fix that?

It's not going to be as simple as using information about the declaration 
specifiers when parsing array declarators, because a static pointer to VLA 
is valid, so it would also be necessary to distinguish whether the 
declaration in question is actually going to be of a static array itself.

Joseph S. Myers

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