[PATCH] Improved __builtin_constant_p

Richard Smith richard at metafoo.co.uk
Wed Jul 16 16:48:48 PDT 2014


On Tue, Jul 15, 2014 at 4:10 AM, Janusz Sobczak <janusz.sobczak at mobica.com>
wrote:

> >>! In D4492#5, @rsmith wrote:
> > This makes Clang's constant expression evaluator and its IR generation
> disagree about the value of `__builtin_constant_p`.
> How would you address this issue? My concern is that there are cases,
> where we need to fold to a constant early (i.e. global variable
> initialisation) and other cases where we can emit IR code and make the
> decision about 'constantness' at a later stage.
>
> >
> > What's the motivation behind this change?
> Matching GCC behaviour as closely as we can.


That seems like a means to an end, rather than a goal in itself. Also, we
currently match GCC's -O0 behavior pretty closely.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140716/cd7c3a0d/attachment.html>


More information about the cfe-commits mailing list