Re: [PATCH] gimplify: Don't optimize register const vars to static [PR93949]

2020-02-29 Thread Uecker, Martin
Am Samstag, den 29.02.2020, 10:57 +0100 schrieb Jakub Jelinek: > On Sat, Feb 29, 2020 at 09:50:00AM +, 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

Re: [PATCH] gimplify: Don't optimize register const vars to static [PR93949]

2020-02-29 Thread Jakub Jelinek
On Sat, Feb 29, 2020 at 09:50:00AM +, 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

Re: [PATCH] gimplify: Don't optimize register const vars to static [PR93949]

2020-02-29 Thread Uecker, Martin
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).

Re: [PATCH] gimplify: Don't optimize register const vars to static [PR93949]

2020-02-27 Thread Richard Biener
On Thu, 27 Feb 2020, Jakub Jelinek wrote: > Hi! > > The following testcase is rejected, while it was accepted in 3.4 and earlier > (before tree-ssa merge). > The problem is that we decide to promote the const variable to TREE_STATIC, > but TREE_STATIC DECL_REGISTER VAR_DECLs may only be the

[PATCH] gimplify: Don't optimize register const vars to static [PR93949]

2020-02-27 Thread Jakub Jelinek
Hi! The following testcase is rejected, while it was accepted in 3.4 and earlier (before tree-ssa merge). The problem is that we decide to promote the const variable to TREE_STATIC, but TREE_STATIC DECL_REGISTER VAR_DECLs may only be the global register vars and so assemble_variable/make_decl_rtl