[PATCH] Teach builtin clz, ctz, and popcount to be const

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jun 11 05:18:03 PDT 2013


On Tue, Jun 11, 2013 at 12:18:55AM -0600, Justin Bogner wrote:
> The clz, ctz, and popcount builtins are trivial to add constant folded
> implementations of, and gcc accepts them in const contexts.
> 
> Can someone please apply this?

Can you test the constant folding with
char foo[f(x) == val ? 1 : -1];

or so?

Joerg



More information about the cfe-commits mailing list