https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94201
Bug ID: 94201
Summary: aarch64:ICE in tiny code model for ilp32
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: duanbo3 at huawei dot com
Target Milestone: ---
Target: aarch64
Created attachment 48048
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48048&action=edit
mcmodel_tiny_for_ilp32.patch
hello
I find an ICE when testing GCC10.0 on aarch64 at -mabi=ilp32 -fPIC
-mcmodel=tiny:
Simple test case
---
extern int bar (void *);
extern long long a;
int
foo (void)
{
a=1;
return bar ((void *)bar);
}
---
GCC version:
gcc version 10.0.1 20200312 (experimental)
Runcommand:
gcc new_test.c -mabi=ilp32 -fPIC -mcmodel=tiny -S -o poc.s
Result:
./new_test.c: In function 'foo':
./new_test.c:14:1: error: unrecognizable insn:
(insn 11 10 12 2 (set (reg:SI 0 x0)
(unspec:DI [
(symbol_ref:SI ("bar") [flags 0x41] <function_decl
0xffffa0cb3b00 bar>)
] UNSPEC_GOTTINYPIC)) "./new_test.c":13:10 -1
(expr_list:REG_EQUAL (symbol_ref:SI ("bar") [flags 0x41] <function_decl
0xffffa0cb3b00 bar>)
(nil)))
during RTL pass: vregs
./new_test.c:14:1: internal compiler error: in extract_insn, at recog.c:2294
0x62858b _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../.././gcc/rtl-error.c:108
0x6285b7 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../.././gcc/rtl-error.c:116
0xc9aa7f extract_insn(rtx_insn*)
../.././gcc/recog.c:2294
0x9c8917 instantiate_virtual_regs_in_insn
../.././gcc/function.c:1607
0x9c8917 instantiate_virtual_regs
../.././gcc/function.c:1977
0x9c8917 execute
../.././gcc/function.c:2026