public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700
@ 2022-12-21  8:06 asolokha at gmx dot com
  2022-12-21  8:24 ` [Bug rtl-optimization/108193] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2022-12-21  8:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108193
           Summary: [13 Regression] ICE in do_SUBST, at combine.cc:700
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

gcc 13.0.0 20221218 snapshot (g:fd69977febf399d1992bbf8d66ae9170e0a4dc9f) ICEs
when compiling the following testcase w/ -O2 -fsplit-loops
-ftree-parallelize-loops=2 -fno-tree-dominator-opts:

subroutine foo (n, r)
  implicit none
  integer :: i, j, n
  real :: s, r(*)

  s = 0.0

  do j = 1, 2
     do i = j, n
        s = r(i)
     end do
  end do

  do i = 1, n
     do j = i, n
        s = s + 1
     end do
     r(i) = s
  end do
end subroutine foo

% aarch64-linux-gnu-gfortran-13 -O2 -fsplit-loops -ftree-parallelize-loops=2
-fno-tree-dominator-opts -c fzcqm8no.f90
during RTL pass: combine
fzcqm8no.f90:20:18:

   20 | end subroutine foo
      |                  ^
internal compiler error: in do_SUBST, at combine.cc:700
0x845011 do_SUBST
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-13.0.0_p20221218/work/gcc-13-20221218/gcc/combine.cc:700
0x1b53990 subst
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-13.0.0_p20221218/work/gcc-13-20221218/gcc/combine.cc:5579
0x1b5671b try_combine
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-13.0.0_p20221218/work/gcc-13-20221218/gcc/combine.cc:3299
0x1b5c19a combine_instructions
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-13.0.0_p20221218/work/gcc-13-20221218/gcc/combine.cc:1410
0x1b5c19a rest_of_handle_combine
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-13.0.0_p20221218/work/gcc-13-20221218/gcc/combine.cc:14978
0x1b5c19a execute
       
/var/tmp/portage/cross-aarch64-linux-gnu/gcc-13.0.0_p20221218/work/gcc-13-20221218/gcc/combine.cc:15023

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
@ 2022-12-21  8:24 ` rguenth at gcc dot gnu.org
  2022-12-21 12:09 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-21  8:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
  2022-12-21  8:24 ` [Bug rtl-optimization/108193] " rguenth at gcc dot gnu.org
@ 2022-12-21 12:09 ` jakub at gcc dot gnu.org
  2022-12-22 11:51 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-21 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-12-21
           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 54141
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54141&action=edit
gcc13-pr108193.patch

Untested fix.  The last hunk in cse.cc is enough, the rest is just to avoid
triggering UB during compilation on aarch64 with certain constants.

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
  2022-12-21  8:24 ` [Bug rtl-optimization/108193] " rguenth at gcc dot gnu.org
  2022-12-21 12:09 ` jakub at gcc dot gnu.org
@ 2022-12-22 11:51 ` cvs-commit at gcc dot gnu.org
  2022-12-22 11:54 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-22 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:0cb5d7cdbab8e5f8359764ef5f62d93c2bc88552

commit r13-4844-g0cb5d7cdbab8e5f8359764ef5f62d93c2bc88552
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 22 12:44:13 2022 +0100

    cse: Fix up CSE const_anchor handling [PR108193]

    The following testcase ICEs on aarch64, because insert_const_anchor
    inserts invalid CONST_INT into the CSE tables - 0x80000000 for SImode.
    The second hunk of the patch fixes that, the first one is to avoid
    triggering undefined behavior at compile time during compute_const_anchors
    computations - performing those additions and subtractions in
    HOST_WIDE_INT means it can overflow for certain constants.

    2022-12-22  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108193
            * cse.cc (compute_const_anchors): Change n type to
            unsigned HOST_WIDE_INT, adjust comparison against it to avoid
            warnings.  Formatting fix.
            (insert_const_anchor): Use gen_int_mode instead of GEN_INT.

            * gfortran.dg/pr108193.f90: New test.

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-12-22 11:51 ` cvs-commit at gcc dot gnu.org
@ 2022-12-22 11:54 ` jakub at gcc dot gnu.org
  2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-22 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk.  Latent on release branches, so I'll likely backport there
too.

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-12-22 11:54 ` jakub at gcc dot gnu.org
@ 2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
  2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
  2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-02-10 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r12-9132-gcb8022eab6d076325495360da632321078326135
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 22 12:44:13 2022 +0100

    cse: Fix up CSE const_anchor handling [PR108193]

    The following testcase ICEs on aarch64, because insert_const_anchor
    inserts invalid CONST_INT into the CSE tables - 0x80000000 for SImode.
    The second hunk of the patch fixes that, the first one is to avoid
    triggering undefined behavior at compile time during compute_const_anchors
    computations - performing those additions and subtractions in
    HOST_WIDE_INT means it can overflow for certain constants.

    2022-12-22  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108193
            * cse.cc (compute_const_anchors): Change n type to
            unsigned HOST_WIDE_INT, adjust comparison against it to avoid
            warnings.  Formatting fix.
            (insert_const_anchor): Use gen_int_mode instead of GEN_INT.

            * gfortran.dg/pr108193.f90: New test.

    (cherry picked from commit 0cb5d7cdbab8e5f8359764ef5f62d93c2bc88552)

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
@ 2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
  2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:eaf236a4ca097727f721443b082d620b1503e61c

commit r11-10694-geaf236a4ca097727f721443b082d620b1503e61c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 22 12:44:13 2022 +0100

    cse: Fix up CSE const_anchor handling [PR108193]

    The following testcase ICEs on aarch64, because insert_const_anchor
    inserts invalid CONST_INT into the CSE tables - 0x80000000 for SImode.
    The second hunk of the patch fixes that, the first one is to avoid
    triggering undefined behavior at compile time during compute_const_anchors
    computations - performing those additions and subtractions in
    HOST_WIDE_INT means it can overflow for certain constants.

    2022-12-22  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108193
            * cse.c (compute_const_anchors): Change n type to
            unsigned HOST_WIDE_INT, adjust comparison against it to avoid
            warnings.  Formatting fix.
            (insert_const_anchor): Use gen_int_mode instead of GEN_INT.

            * gfortran.dg/pr108193.f90: New test.

    (cherry picked from commit 0cb5d7cdbab8e5f8359764ef5f62d93c2bc88552)

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

* [Bug rtl-optimization/108193] [13 Regression] ICE in do_SUBST, at combine.cc:700
  2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
@ 2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:14cb8af5a6a1f09250a207359535399fedbbb4ff

commit r10-11352-g14cb8af5a6a1f09250a207359535399fedbbb4ff
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 22 12:44:13 2022 +0100

    cse: Fix up CSE const_anchor handling [PR108193]

    The following testcase ICEs on aarch64, because insert_const_anchor
    inserts invalid CONST_INT into the CSE tables - 0x80000000 for SImode.
    The second hunk of the patch fixes that, the first one is to avoid
    triggering undefined behavior at compile time during compute_const_anchors
    computations - performing those additions and subtractions in
    HOST_WIDE_INT means it can overflow for certain constants.

    2022-12-22  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/108193
            * cse.c (compute_const_anchors): Change n type to
            unsigned HOST_WIDE_INT, adjust comparison against it to avoid
            warnings.  Formatting fix.
            (insert_const_anchor): Use gen_int_mode instead of GEN_INT.

            * gfortran.dg/pr108193.f90: New test.

    (cherry picked from commit 0cb5d7cdbab8e5f8359764ef5f62d93c2bc88552)

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

end of thread, other threads:[~2023-05-03 15:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21  8:06 [Bug rtl-optimization/108193] New: [13 Regression] ICE in do_SUBST, at combine.cc:700 asolokha at gmx dot com
2022-12-21  8:24 ` [Bug rtl-optimization/108193] " rguenth at gcc dot gnu.org
2022-12-21 12:09 ` jakub at gcc dot gnu.org
2022-12-22 11:51 ` cvs-commit at gcc dot gnu.org
2022-12-22 11:54 ` jakub at gcc dot gnu.org
2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03 15:20 ` cvs-commit 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).