https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103085
Bug ID: 103085 Summary: [12 Regression] -fPIC and -fstack-protector-strong broken AArch64 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: tnfchris at gcc dot gnu.org CC: wilco at gcc dot gnu.org Target Milestone: --- Target: aarch64-* -fPIC and -fstack-protector-strong are broken since g:a195c7270e4705a06a9aaade0d721d5f52ca2275 The following testcase --- struct A { int operator*(); void operator++(); friend bool operator!=(A, A); }; class B { public: A begin(); A end(); }; class C { void emitMaps(); B Events; }; void C::emitMaps() { for (auto a : Events) ; } ---- ICEs with gcc -O2 -g -fstack-protector-strong -fPIC -c -std=c++11 foo.cpp: In member function 'void C::emitMaps()': foo.cpp:18:1: error: unrecognizable insn: 18 | } | ^ (insn 4 3 5 2 (set (reg:DI 96) (const:DI (unspec:DI [ (symbol_ref:DI ("__stack_chk_guard") [flags 0xc0] <var_decl 0xffffb7a96360 __stack_chk_guard>) (const_int 0 [0]) ] UNSPEC_SALT_ADDR))) "foo.cpp":15:20 -1 (nil)) during RTL pass: vregs foo.cpp:18:1: internal compiler error: in extract_insn, at recog.c:2769 0x750627 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ../../gcc-fsf/gcc/rtl-error.c:108 0x750653 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) ../../gcc-fsf/gcc/rtl-error.c:116 0x10e332b extract_insn(rtx_insn*) ../../gcc-fsf/gcc/recog.c:2769 0xdf6477 instantiate_virtual_regs_in_insn ../../gcc-fsf/gcc/function.c:1611 0xdf6477 instantiate_virtual_regs ../../gcc-fsf/gcc/function.c:1985 0xdf6477 execute ../../gcc-fsf/gcc/function.c:2034 because the salt address is no longer folded away.