middle-end/112296 - __builtin_constant_p and side-effects
commit442715708911ed6cc6f3785e3996a62f5ee7f21f
authorRichard Biener <rguenther@suse.de>
Fri, 3 Nov 2023 07:11:05 +0000 (3 08:11 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 6 Nov 2023 07:24:34 +0000 (6 08:24 +0100)
tree78aabbd6ceaf76b99ed0489761cf69244597cdaf
parentb2075291af8810794c7184fd125b991c2341cb1e
middle-end/112296 - __builtin_constant_p and side-effects

The following tries to clarify the __builtin_constant_p documentation,
stating that the argument expression is not evaluated and side-effects
are discarded.  I'm struggling to find the correct terms matching
what the C language standard would call things so I'd appreciate
some help here.

OK for trunk?

Shall we diagnose arguments with side-effects?  It seems to me
such use is usually unintended?  I think rather than dropping
side-effects as a side-effect of folding the frontend should
discard them at parsing time instead, no?

Thanks,
Richard.

PR middle-end/112296
* doc/extend.texi (__builtin_constant_p): Clarify that
side-effects are discarded.
gcc/doc/extend.texi