https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104910

            Bug ID: 104910
           Summary: [10/11/12 Regression] ICE: internal consistency
                    failure (error: invalid rtl sharing found in the insn)
           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: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

Created attachment 52621
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52621&action=edit
-freport-bug output

gcc 12.0.1 20220313 snapshot (g:7e28750395889d16a9cba49cd5935ced7dc00ce8) ICEs
when compiling the following testcase w/ -Os -fstack-protector-all
-fno-forward-propagate -fno-PIC:

void
bar (void);

void
foo (int x)
{
  if (x)
    bar ();
}

% aarch64-linux-gnu-gcc-12.0.1 -Os -fstack-protector-all -fno-forward-propagate
-fno-PIC -c k1n69laf.c
k1n69laf.c: In function 'foo':
k1n69laf.c:9:1: error: invalid rtl sharing found in the insn
    9 | }
      | ^
(insn 51 50 10 2 (set (reg/f:DI 100)
        (lo_sum:DI (reg:DI 101)
            (const:DI (unspec:DI [
                        (symbol_ref:DI ("__stack_chk_guard") [flags 0xc0]
<var_decl 0x7fb7e4364240 __stack_chk_guard>)
                        (const_int 1 [0x1])
                    ] UNSPEC_SALT_ADDR)))) -1
     (expr_list:REG_EQUAL (const:DI (unspec:DI [
                    (symbol_ref:DI ("__stack_chk_guard") [flags 0xc0] <var_decl
0x7fb7e4364240 __stack_chk_guard>)
                    (const_int 1 [0x1])
                ] UNSPEC_SALT_ADDR))
        (nil)))
k1n69laf.c:9:1: error: shared rtx
(const:DI (unspec:DI [
            (symbol_ref:DI ("__stack_chk_guard") [flags 0xc0] <var_decl
0x7fb7e4364240 __stack_chk_guard>)
            (const_int 1 [0x1])
        ] UNSPEC_SALT_ADDR))
during RTL pass: hoist
k1n69laf.c:9:1: internal compiler error: internal consistency failure
0xaf3439 verify_rtx_sharing
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/emit-rtl.cc:2898
0xaf335d verify_rtx_sharing
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/emit-rtl.cc:2913
0xaf335d verify_rtx_sharing
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/emit-rtl.cc:2913
0xaf37cf verify_insn_sharing
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/emit-rtl.cc:2984
0xaf883e verify_rtl_sharing()
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/emit-rtl.cc:3007
0xe138f1 execute_function_todo
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/passes.cc:2105
0xe13e4b execute_todo
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-12.0.1_p20220313/work/gcc-12-20220313/gcc/passes.cc:2138

Reply via email to