public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
@ 2022-03-14  9:49 asolokha at gmx dot com
  2022-03-14 11:48 ` [Bug target/104910] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2022-03-14  9:49 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
@ 2022-03-14 11:48 ` jakub at gcc dot gnu.org
  2022-03-14 14:29 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-14 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-03-14
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52623
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52623&action=edit
gcc12-pr104910.patch

Untested fix.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
  2022-03-14 11:48 ` [Bug target/104910] " jakub at gcc dot gnu.org
@ 2022-03-14 14:29 ` rguenth at gcc dot gnu.org
  2022-03-16 10:04 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-14 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
  2022-03-14 11:48 ` [Bug target/104910] " jakub at gcc dot gnu.org
  2022-03-14 14:29 ` rguenth at gcc dot gnu.org
@ 2022-03-16 10:04 ` cvs-commit at gcc dot gnu.org
  2022-03-16 10:05 ` [Bug target/104910] [10/11 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-16 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:952155629ca1a4dfe7c7b26e53d118a9b853ed4a

commit r12-7666-g952155629ca1a4dfe7c7b26e53d118a9b853ed4a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Mar 16 11:04:16 2022 +0100

    aarch64: Fix up RTL sharing bug in aarch64_load_symref_appropriately
[PR104910]

    We unshare all RTL created during expansion, but when
    aarch64_load_symref_appropriately is called after expansion like in the
    following testcases, we use imm in both HIGH and LO_SUM operands.
    If imm is some RTL that shouldn't be shared like a non-sharable CONST,
    we get at least with --enable-checking=rtl a checking ICE, otherwise might
    just get silently wrong code.

    The following patch fixes that by copying it if it can't be shared.

    2022-03-16  Jakub Jelinek  <jakub@redhat.com>

            PR target/104910
            * config/aarch64/aarch64.cc (aarch64_load_symref_appropriately):
Copy
            imm rtx.

            * gcc.dg/pr104910.c: New test.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10/11 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-03-16 10:04 ` cvs-commit at gcc dot gnu.org
@ 2022-03-16 10:05 ` jakub at gcc dot gnu.org
  2022-03-29  5:54 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-16 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression] ICE:  |[10/11 Regression] ICE:
                   |internal consistency        |internal consistency
                   |failure (error: invalid rtl |failure (error: invalid rtl
                   |sharing found in the insn)  |sharing found in the insn)

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10/11 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-03-16 10:05 ` [Bug target/104910] [10/11 " jakub at gcc dot gnu.org
@ 2022-03-29  5:54 ` cvs-commit at gcc dot gnu.org
  2022-03-30  8:15 ` [Bug target/104910] [10 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-29  5:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:9c3225c8b7c7f74a53aaae6ed5b6463b55bf7a92

commit r11-9728-g9c3225c8b7c7f74a53aaae6ed5b6463b55bf7a92
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Mar 16 11:04:16 2022 +0100

    aarch64: Fix up RTL sharing bug in aarch64_load_symref_appropriately
[PR104910]

    We unshare all RTL created during expansion, but when
    aarch64_load_symref_appropriately is called after expansion like in the
    following testcases, we use imm in both HIGH and LO_SUM operands.
    If imm is some RTL that shouldn't be shared like a non-sharable CONST,
    we get at least with --enable-checking=rtl a checking ICE, otherwise might
    just get silently wrong code.

    The following patch fixes that by copying it if it can't be shared.

    2022-03-16  Jakub Jelinek  <jakub@redhat.com>

            PR target/104910
            * config/aarch64/aarch64.c (aarch64_load_symref_appropriately):
Copy
            imm rtx.

            * gcc.dg/pr104910.c: New test.

    (cherry picked from commit 952155629ca1a4dfe7c7b26e53d118a9b853ed4a)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-03-29  5:54 ` cvs-commit at gcc dot gnu.org
@ 2022-03-30  8:15 ` jakub at gcc dot gnu.org
  2022-05-10  8:25 ` cvs-commit at gcc dot gnu.org
  2022-05-10 10:26 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-30  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression] ICE:     |[10 Regression] ICE:
                   |internal consistency        |internal consistency
                   |failure (error: invalid rtl |failure (error: invalid rtl
                   |sharing found in the insn)  |sharing found in the insn)

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.3 too.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-03-30  8:15 ` [Bug target/104910] [10 " jakub at gcc dot gnu.org
@ 2022-05-10  8:25 ` cvs-commit at gcc dot gnu.org
  2022-05-10 10:26 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:c9b590a80fbe16a118acdbab15e6f82853db6806

commit r10-10695-gc9b590a80fbe16a118acdbab15e6f82853db6806
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Mar 16 11:04:16 2022 +0100

    aarch64: Fix up RTL sharing bug in aarch64_load_symref_appropriately
[PR104910]

    We unshare all RTL created during expansion, but when
    aarch64_load_symref_appropriately is called after expansion like in the
    following testcases, we use imm in both HIGH and LO_SUM operands.
    If imm is some RTL that shouldn't be shared like a non-sharable CONST,
    we get at least with --enable-checking=rtl a checking ICE, otherwise might
    just get silently wrong code.

    The following patch fixes that by copying it if it can't be shared.

    2022-03-16  Jakub Jelinek  <jakub@redhat.com>

            PR target/104910
            * config/aarch64/aarch64.c (aarch64_load_symref_appropriately):
Copy
            imm rtx.

            * gcc.dg/pr104910.c: New test.

    (cherry picked from commit 952155629ca1a4dfe7c7b26e53d118a9b853ed4a)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug target/104910] [10 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn)
  2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-05-10  8:25 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 10:26 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-10 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.4 too.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-10 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14  9:49 [Bug target/104910] New: [10/11/12 Regression] ICE: internal consistency failure (error: invalid rtl sharing found in the insn) asolokha at gmx dot com
2022-03-14 11:48 ` [Bug target/104910] " jakub at gcc dot gnu.org
2022-03-14 14:29 ` rguenth at gcc dot gnu.org
2022-03-16 10:04 ` cvs-commit at gcc dot gnu.org
2022-03-16 10:05 ` [Bug target/104910] [10/11 " jakub at gcc dot gnu.org
2022-03-29  5:54 ` cvs-commit at gcc dot gnu.org
2022-03-30  8:15 ` [Bug target/104910] [10 " jakub at gcc dot gnu.org
2022-05-10  8:25 ` cvs-commit at gcc dot gnu.org
2022-05-10 10:26 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).