https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> --- register const void __user *__p asm("r0") = __ptr; etc. isn't a problem, here __p isn't const, only *__p is. The problem is if the register variable itself is const. So arch/h8300/kernel/sim-console.c: register const unsigned _len __asm__("er2") = n; If n can be a constant or is const var initialized to constant etc. The cases where a const register var doesn't have an initializer aren't a problem either. I don't see what should we warn about.