public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og
@ 2020-03-23 18:55 zsojka at seznam dot cz
  2020-03-24  6:20 ` [Bug rtl-optimization/94291] " marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: zsojka at seznam dot cz @ 2020-03-23 18:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94291
           Summary: [10 Regression] ICE: in reg_or_subregno, at
                    jump.c:1928 at -Og
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: armv7a-hardfloat-linux-gnueabi

Created attachment 48100
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48100&action=edit
reduced testcase

Compiler output:
$ armv7a-hardfloat-linux-gnueabi-gcc -Og testcase.c
during RTL pass: combine
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: in reg_or_subregno, at jump.c:1928
    9 | }
      | ^
0x6a4bbd reg_or_subregno(rtx_def const*)
        /repo/gcc-trunk/gcc/jump.c:1928
0x1983a69 try_combine
        /repo/gcc-trunk/gcc/combine.c:4355
0x1988c63 combine_instructions
        /repo/gcc-trunk/gcc/combine.c:1303
0x1988c63 rest_of_handle_combine
        /repo/gcc-trunk/gcc/combine.c:15059
0x1988c63 execute
        /repo/gcc-trunk/gcc/combine.c:15104
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ armv7a-hardfloat-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-armv7a-hardfloat/bin/armv7a-hardfloat-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r10-7327-20200323085706-g2fa4b1ffd6e-checking-yes-rtl-df-extra-pr94286-armv7a-hardfloat/bin/../libexec/gcc/armv7a-hardfloat-linux-gnueabi/10.0.1/lto-wrapper
Target: armv7a-hardfloat-linux-gnueabi
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-float=hard --with-fpu=vfpv4
--with-arch=armv7-a --with-sysroot=/usr/armv7a-hardfloat-linux-gnueabi
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=armv7a-hardfloat-linux-gnueabi
--with-ld=/usr/bin/armv7a-hardfloat-linux-gnueabi-ld
--with-as=/usr/bin/armv7a-hardfloat-linux-gnueabi-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r10-7327-20200323085706-g2fa4b1ffd6e-checking-yes-rtl-df-extra-pr94286-armv7a-hardfloat
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.1 20200323 (experimental) (GCC)

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
@ 2020-03-24  6:20 ` marxin at gcc dot gnu.org
  2020-03-24  6:36 ` [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754 marxin at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-24  6:20 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-03-24
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Keywords|                            |needs-bisection
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I'm bisecting that.

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
  2020-03-24  6:20 ` [Bug rtl-optimization/94291] " marxin at gcc dot gnu.org
@ 2020-03-24  6:36 ` marxin at gcc dot gnu.org
  2020-03-24 11:47 ` [Bug target/94291] " jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-24  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rearnsha at gcc dot gnu.org
            Summary|[10 Regression] ICE: in     |[10 Regression] ICE: in
                   |reg_or_subregno, at         |reg_or_subregno, at
                   |jump.c:1928 at -Og          |jump.c:1928 at -Og since
                   |                            |r10-3993-ga79048f6250febc1a
                   |                            |cce09d790035276d534e754
           Keywords|needs-bisection             |
   Target Milestone|---                         |10.0

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-3993-ga79048f6250febc1acce09d790035276d534e754.

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

* [Bug target/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
  2020-03-24  6:20 ` [Bug rtl-optimization/94291] " marxin at gcc dot gnu.org
  2020-03-24  6:36 ` [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754 marxin at gcc dot gnu.org
@ 2020-03-24 11:47 ` jakub at gcc dot gnu.org
  2020-03-24 11:53 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-24 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |segher at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess this is related to PR84169
r8-6756-gba95aa209678e681dcc86df9ebd0a39501c70187
The code assumes that for split_i2i3 SET_DEST must be a REG or SUBREG of REG,
but nothing actually checks this.  In the testcase it is a MEM instead.

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

* [Bug target/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2020-03-24 11:47 ` [Bug target/94291] " jakub at gcc dot gnu.org
@ 2020-03-24 11:53 ` jakub at gcc dot gnu.org
  2020-04-01  7:48 ` [Bug rtl-optimization/94291] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-24 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is on try_combine on:
(gdb) p debug_rtx (i3)
(insn 20 12 22 2 (set (mem/c:SI (plus:SI (reg/f:SI 102 sfp)
                (const_int -4 [0xfffffffffffffffc])) [1 x+0 S4 A32])
        (reg:SI 125)) "pr94291.c":7:8 241 {*arm_movsi_insn}
     (expr_list:REG_DEAD (reg:SI 125)
        (nil)))
(gdb) p debug_rtx (i2)
(insn 12 7 20 2 (parallel [
            (set (reg:CC 100 cc)
                (compare:CC (reg:SI 121 [ <retval> ])
                    (const_int 0 [0])))
            (set (reg:SI 125)
                (reg:SI 121 [ <retval> ]))
        ]) "pr94291.c":7:8 248 {*movsi_compare0}
     (expr_list:REG_UNUSED (reg:CC 100 cc)
        (nil)))
where it is merged into cc = r121 cmp 0; [sfp-4] = r121 and as that isn't
recognized, it is being split_i2i3 into: [sfp-4] = r121 followed by cc = r121
cmp 0 where SET_DEST of newi2pat is a MEM rather than REG.
So, either we should somewhere punt instead of set split_i2i3 because the dest
is a MEM, not REG, or we should handle it somehow.

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2020-03-24 11:53 ` jakub at gcc dot gnu.org
@ 2020-04-01  7:48 ` rguenth at gcc dot gnu.org
  2020-04-01  7:57 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-01  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2020-04-01  7:48 ` [Bug rtl-optimization/94291] " rguenth at gcc dot gnu.org
@ 2020-04-01  7:57 ` jakub at gcc dot gnu.org
  2020-04-07 19:31 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-01  7:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2020-March/5
                   |                            |42953.html

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2020-04-01  7:57 ` jakub at gcc dot gnu.org
@ 2020-04-07 19:31 ` cvs-commit at gcc dot gnu.org
  2020-04-07 20:02 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-07 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r10-7607-gc23c899aedf11069e992eed7358802b262d62f98
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 7 21:30:12 2020 +0200

    combine: Fix split_i2i3 ICE [PR94291]

    The following testcase ICEs on armv7hl-linux-gnueabi.
    try_combine is called on:
    (gdb) p debug_rtx (i3)
    (insn 20 12 22 2 (set (mem/c:SI (plus:SI (reg/f:SI 102 sfp)
                    (const_int -4 [0xfffffffffffffffc])) [1 x+0 S4 A32])
            (reg:SI 125)) "pr94291.c":7:8 241 {*arm_movsi_insn}
         (expr_list:REG_DEAD (reg:SI 125)
            (nil)))
    (gdb) p debug_rtx (i2)
    (insn 12 7 20 2 (parallel [
                (set (reg:CC 100 cc)
                    (compare:CC (reg:SI 121 [ <retval> ])
                        (const_int 0 [0])))
                (set (reg:SI 125)
                    (reg:SI 121 [ <retval> ]))
            ]) "pr94291.c":7:8 248 {*movsi_compare0}
         (expr_list:REG_UNUSED (reg:CC 100 cc)
            (nil)))
    and tries to recognize cc = r121 cmp 0; [sfp-4] = r121 parallel,
    but that isn't recognized, so it splits it into two: split_i2i3
    [sfp-4] = r121 followed by cc = r121 cmp 0 which is recognized, but
    ICEs because the code below insist that the SET_DEST of newi2pat
    (or first set in PARALLEL thereof) must be a REG or SUBREG of REG,
    but it is a MEM in this case.  I don't see any condition that would
    guarantee that, perhaps for the swap_i2i3 case it was somehow guaranteed.

    As the code just wants to update LOG_LINKS and LOG_LINKS are only for
    registers, not for MEM or anything else, the patch just doesn't update
those
    if it isn't a REG or SUBREG of REG.

    2020-04-07  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/94291
            PR rtl-optimization/84169
            * combine.c (try_combine): For split_i2i3, don't assume SET_DEST
            must be a REG or SUBREG of REG; if it is not one of these, don't
            update LOG_LINKs.

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

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2020-04-07 19:31 ` cvs-commit at gcc dot gnu.org
@ 2020-04-07 20:02 ` jakub at gcc dot gnu.org
  2020-04-07 20:39 ` segher at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-07 20:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2020-04-07 20:02 ` jakub at gcc dot gnu.org
@ 2020-04-07 20:39 ` segher at gcc dot gnu.org
  2020-04-07 20:42 ` jakub at gcc dot gnu.org
  2020-04-07 20:54 ` segher at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: segher at gcc dot gnu.org @ 2020-04-07 20:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Doesn't it still need backports?

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2020-04-07 20:39 ` segher at gcc dot gnu.org
@ 2020-04-07 20:42 ` jakub at gcc dot gnu.org
  2020-04-07 20:54 ` segher at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-07 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think they won't hurt, but we don't have a testcase that FAILs in 9.x, so the
regression is fixed.

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

* [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754
  2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
                   ` (9 preceding siblings ...)
  2020-04-07 20:42 ` jakub at gcc dot gnu.org
@ 2020-04-07 20:54 ` segher at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: segher at gcc dot gnu.org @ 2020-04-07 20:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Segher Boessenkool <segher at gcc dot gnu.org> ---
You mean you do not have a good enough testcase yet :-(  Okay.

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

end of thread, other threads:[~2020-04-07 20:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 18:55 [Bug rtl-optimization/94291] New: [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og zsojka at seznam dot cz
2020-03-24  6:20 ` [Bug rtl-optimization/94291] " marxin at gcc dot gnu.org
2020-03-24  6:36 ` [Bug rtl-optimization/94291] [10 Regression] ICE: in reg_or_subregno, at jump.c:1928 at -Og since r10-3993-ga79048f6250febc1acce09d790035276d534e754 marxin at gcc dot gnu.org
2020-03-24 11:47 ` [Bug target/94291] " jakub at gcc dot gnu.org
2020-03-24 11:53 ` jakub at gcc dot gnu.org
2020-04-01  7:48 ` [Bug rtl-optimization/94291] " rguenth at gcc dot gnu.org
2020-04-01  7:57 ` jakub at gcc dot gnu.org
2020-04-07 19:31 ` cvs-commit at gcc dot gnu.org
2020-04-07 20:02 ` jakub at gcc dot gnu.org
2020-04-07 20:39 ` segher at gcc dot gnu.org
2020-04-07 20:42 ` jakub at gcc dot gnu.org
2020-04-07 20:54 ` segher 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).