On Thu, Aug 05, 2021 at 02:31:02PM +0530, Prathamesh Kulkarni wrote: > On Wed, 4 Aug 2021 at 18:30, Richard Earnshaw > <richard.earns...@foss.arm.com> wrote: > > We don't want to have to resort to macros. Not least because at some > > point we want to replace the content of arm_neon.h with a single #pragma > > directive to remove all the parsing of the header that's needed. What's > > more, if we had a suitable pragma we'd stand a fighting chance of being > > able to extend support to other languages as well that don't use the > > pre-processor, such as Fortran or Ada (not that that is on the cards > > right now). > Hi, > IIUC, a more general issue here, is that the intrinsics require > special type-checking of arguments, beyond what is dictated by the > Standard. > An argument needing to be an ICE could be seen as one instance. > > So perhaps, should there be some mechanism to tell the FE to let the > target do additional checking for a particular function call, say by
An integer constant expression can be checked by the frontend itself, it does not depend on optimisation etc. That is the beauty of it: it is a) more local, and b) a more reliable / less surprising thing to use. But it *is* less powerful than "it is a constant integer after a travel through the bowels of the compiler". Which of course is less reliable and more surprising (think what happens if you use -O0 or -O1 or -Og or -Os or any -fno- etc.) So it will be a lot more maintenance work (answering PRs about it is only the start). Segher