Am Samstag, den 29.02.2020, 10:57 +0100 schrieb Jakub Jelinek: > On Sat, Feb 29, 2020 at 09:50:00AM +0000, Uecker, Martin wrote: > > One could also simply remove the error in varasm.c. This > > would preserve the optimization. As a side effect, this > > would allow register without __asm__ at file scope, but > > there do not seem to be any disadvantages. (register > > at file scope is already diagnosed by the C FE when > > using --pedantic). > > First of all, such a change wouldn't be appropriate for backports,
Ok. > and IMHO > makes only sense if we actually start optimizing based on that (assuming > the address of the var can't be taken in alias analysis etc.). FYI: There is a proposal for C2X from a developer of compiler for small embedded systems to allow this for optimization. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2486.htm Best, Martin