https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80353
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |jakub at gcc dot gnu.org Resolution|--- |INVALID --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- At -O0 that is a user error, the intrinsics have to be called with a compile time constant and -O0 doesn't perform optimizations. That is e.g. why the intrinsics that need that are at -O0 not defined as inline functions, but as preprocessor macros. So, just pass to those constants rather than variables, or say constexpr vars or something similar where you are guaranteed it is evaluated to constant at compile time. Or compile with optimizations.