Ping. https://gcc.gnu.org/ml/gcc-patches/2016-12/msg00849.html
Thanks, Kyrill On 09/12/16 14:03, Kyrill Tkachov wrote:
Hi all, In this ICE GCC reports invalid RTL sharing in the pattern: (insn 955 954 956 (unspec_volatile [ (const:SI (unspec:SI [ (symbol_ref:SI ("a") [flags 0xe8] <var_decl 0x7fbb0d37cbd0 a>) (const_int 4 [0x4]) ] UNSPEC_TLS)) ] VUNSPEC_POOL_4) -1 (nil)) seb.c:116:1: error: shared rtx (const:SI (unspec:SI [ (symbol_ref:SI ("a") [flags 0xe8] <var_decl 0x7fbb0d37cbd0 a>) (const_int 4 [0x4]) ] UNSPEC_TLS)) This is the consttable_4 pattern emitted by dump_minipool and the shared rtx that's causing the problem is the operand to that pattern that comes from the 'value' field of Mnode. I'm not very familiar with the exact restrictions on sharing RTL but I believe the right way to fix these is to do a copy_rtx of the value we want to use. So this patch does that when the pool entries are emitted. The ICE is quite fragile. See the PR for more details, but I've been able to reliably reproduce it on an arm-none-linux-gnueabihf target with -mcpu=arm7tdmi -mfloat-abi=soft -mfpu=vfp -mthumb and this patch fixes that there. Bootstrapped and tested on arm-none-linux-gnueabihf. Ok for trunk? Thanks, Kyrill 2016-12-09 Kyrylo Tkachov <kyrylo.tkac...@arm.com> PR target/78694 * config/arm/arm.c (dump_minipool): Copy mp->value before emitting it in the minipool to avoid invalid RTL sharing. 2016-12-09 Kyrylo Tkachov <kyrylo.tkac...@arm.com> PR target/78694 * gcc.c-torture/compile/pr78694.c: New test.