public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
@ 2022-02-15 20:16 zsojka at seznam dot cz
  2022-02-15 23:39 ` [Bug debug/104557] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2022-02-15 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104557
           Summary: [12 Regression] ICE: in simplify_subreg, at
                    simplify-rtx.cc:7324 with -O -g
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -g testcase.c
testcase.c: In function 'bar':
testcase.c:7:1: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
    7 | {
      | ^
during RTL pass: vartrack
testcase.c:12:1: internal compiler error: in simplify_subreg, at
simplify-rtx.cc:7324
   12 | }
      | ^
0x782476 simplify_context::simplify_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
        /repo/gcc-trunk/gcc/simplify-rtx.cc:7324
0x13771d9 simplify_context::simplify_gen_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
        /repo/gcc-trunk/gcc/simplify-rtx.cc:7602
0x16ac5b3 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode,
poly_int<1u, unsigned long>)
        /repo/gcc-trunk/gcc/rtl.h:3534
0x16ac5b3 vt_expand_loc_callback
        /repo/gcc-trunk/gcc/var-tracking.cc:8524
0xec90e1 cselib_expand_value_rtx_1
        /repo/gcc-trunk/gcc/cselib.cc:1848
0xeca75e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /repo/gcc-trunk/gcc/cselib.cc:1731
0x16ac149 vt_expand_var_loc_chain
        /repo/gcc-trunk/gcc/var-tracking.cc:8420
0x16ac759 vt_expand_loc_callback
        /repo/gcc-trunk/gcc/var-tracking.cc:8583
0xec93b0 cselib_expand_value_rtx_1
        /repo/gcc-trunk/gcc/cselib.cc:1883
0xeca75e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /repo/gcc-trunk/gcc/cselib.cc:1731
0x16ac149 vt_expand_var_loc_chain
        /repo/gcc-trunk/gcc/var-tracking.cc:8420
0x16ac759 vt_expand_loc_callback
        /repo/gcc-trunk/gcc/var-tracking.cc:8583
0xeca75e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /repo/gcc-trunk/gcc/cselib.cc:1731
0x16ac570 vt_expand_loc_callback
        /repo/gcc-trunk/gcc/var-tracking.cc:8517
0xec90e1 cselib_expand_value_rtx_1
        /repo/gcc-trunk/gcc/cselib.cc:1848
0xec9506 cselib_expand_value_rtx_1
        /repo/gcc-trunk/gcc/cselib.cc:1938
0xeca75e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
        /repo/gcc-trunk/gcc/cselib.cc:1731
0x16ac149 vt_expand_var_loc_chain
        /repo/gcc-trunk/gcc/var-tracking.cc:8420
0x16ac759 vt_expand_loc_callback
        /repo/gcc-trunk/gcc/var-tracking.cc:8583
0xec93b0 cselib_expand_value_rtx_1
        /repo/gcc-trunk/gcc/cselib.cc:1883
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-7249-20220215180935-g8e84b2b37a5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-7249-20220215180935-g8e84b2b37a5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220215 (experimental) (GCC)

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
@ 2022-02-15 23:39 ` pinskia at gcc dot gnu.org
  2022-02-16  9:46 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-15 23:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
  2022-02-15 23:39 ` [Bug debug/104557] " pinskia at gcc dot gnu.org
@ 2022-02-16  9:46 ` jakub at gcc dot gnu.org
  2022-02-16 10:57 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-16  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection             |
             Status|UNCONFIRMED                 |NEW
           Priority|P3                          |P1
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-02-16
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Unsuprisingly started with my
r12-7240-g2801f23fb82a5ef51c8b460a500786797943e1e9

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
  2022-02-15 23:39 ` [Bug debug/104557] " pinskia at gcc dot gnu.org
  2022-02-16  9:46 ` jakub at gcc dot gnu.org
@ 2022-02-16 10:57 ` jakub at gcc dot gnu.org
  2022-02-17 10:15 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-16 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

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

Untested fix.

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-02-16 10:57 ` jakub at gcc dot gnu.org
@ 2022-02-17 10:15 ` cvs-commit at gcc dot gnu.org
  2022-02-17 10:18 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:1c2b44b52364cb5661095b346de794bc7ff02866

commit r12-7275-g1c2b44b52364cb5661095b346de794bc7ff02866
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 17 11:14:38 2022 +0100

    valtrack: Avoid creating raw SUBREGs with VOIDmode argument [PR104557]

    After the recent r12-7240 simplify_immed_subreg changes, we bail on more
    simplify_subreg calls than before, e.g. apparently for decimal modes
    in the NaN representations  we almost never preserve anything except the
    canonical {q,s}NaNs.
    simplify_gen_subreg will punt in such cases because a SUBREG with VOIDmode
    is not valid, but debug_lowpart_subreg wants to attempt even harder, even
    if e.g. target indicates certain mode combinations aren't valid for the
    backend, dwarf2out can still handle them.  But a SUBREG from a VOIDmode
    operand is just too much, the inner mode is lost there.  We'd need some
    new rtx that would be able to represent those cases.
    For now, just punt in those cases.

    2022-02-17  Jakub Jelinek  <jakub@redhat.com>

            PR debug/104557
            * valtrack.cc (debug_lowpart_subreg): Don't call gen_rtx_raw_SUBREG
            if expr has VOIDmode.

            * gcc.dg/dfp/pr104557.c: New test.

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-02-17 10:15 ` cvs-commit at gcc dot gnu.org
@ 2022-02-17 10:18 ` jakub at gcc dot gnu.org
  2022-02-19  8:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-17 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-02-17 10:18 ` jakub at gcc dot gnu.org
@ 2022-02-19  8:03 ` cvs-commit at gcc dot gnu.org
  2022-05-10  8:24 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:25 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-19  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:3eecfec27666b16b2ef855f32ba3f975e087dec1

commit r11-9611-g3eecfec27666b16b2ef855f32ba3f975e087dec1
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 17 11:14:38 2022 +0100

    valtrack: Avoid creating raw SUBREGs with VOIDmode argument [PR104557]

    After the recent r12-7240 simplify_immed_subreg changes, we bail on more
    simplify_subreg calls than before, e.g. apparently for decimal modes
    in the NaN representations  we almost never preserve anything except the
    canonical {q,s}NaNs.
    simplify_gen_subreg will punt in such cases because a SUBREG with VOIDmode
    is not valid, but debug_lowpart_subreg wants to attempt even harder, even
    if e.g. target indicates certain mode combinations aren't valid for the
    backend, dwarf2out can still handle them.  But a SUBREG from a VOIDmode
    operand is just too much, the inner mode is lost there.  We'd need some
    new rtx that would be able to represent those cases.
    For now, just punt in those cases.

    2022-02-17  Jakub Jelinek  <jakub@redhat.com>

            PR debug/104557
            * valtrack.c (debug_lowpart_subreg): Don't call gen_rtx_raw_SUBREG
            if expr has VOIDmode.

            * gcc.dg/dfp/pr104557.c: New test.

    (cherry picked from commit 1c2b44b52364cb5661095b346de794bc7ff02866)

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2022-02-19  8:03 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10  8:24 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:25 ` cvs-commit 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:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:741cc95e8b27cc134fa4f027eb8718feb49f7cc5

commit r10-10685-g741cc95e8b27cc134fa4f027eb8718feb49f7cc5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 17 11:14:38 2022 +0100

    valtrack: Avoid creating raw SUBREGs with VOIDmode argument [PR104557]

    After the recent r12-7240 simplify_immed_subreg changes, we bail on more
    simplify_subreg calls than before, e.g. apparently for decimal modes
    in the NaN representations  we almost never preserve anything except the
    canonical {q,s}NaNs.
    simplify_gen_subreg will punt in such cases because a SUBREG with VOIDmode
    is not valid, but debug_lowpart_subreg wants to attempt even harder, even
    if e.g. target indicates certain mode combinations aren't valid for the
    backend, dwarf2out can still handle them.  But a SUBREG from a VOIDmode
    operand is just too much, the inner mode is lost there.  We'd need some
    new rtx that would be able to represent those cases.
    For now, just punt in those cases.

    2022-02-17  Jakub Jelinek  <jakub@redhat.com>

            PR debug/104557
            * valtrack.c (debug_lowpart_subreg): Don't call gen_rtx_raw_SUBREG
            if expr has VOIDmode.

            * gcc.dg/dfp/pr104557.c: New test.

    (cherry picked from commit 1c2b44b52364cb5661095b346de794bc7ff02866)

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

* [Bug debug/104557] [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g
  2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2022-05-10  8:24 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11  6:25 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11  6:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r9-10132-geca81c14d525ae86463a522275b7ac8be5cdb626
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Feb 17 11:14:38 2022 +0100

    valtrack: Avoid creating raw SUBREGs with VOIDmode argument [PR104557]

    After the recent r12-7240 simplify_immed_subreg changes, we bail on more
    simplify_subreg calls than before, e.g. apparently for decimal modes
    in the NaN representations  we almost never preserve anything except the
    canonical {q,s}NaNs.
    simplify_gen_subreg will punt in such cases because a SUBREG with VOIDmode
    is not valid, but debug_lowpart_subreg wants to attempt even harder, even
    if e.g. target indicates certain mode combinations aren't valid for the
    backend, dwarf2out can still handle them.  But a SUBREG from a VOIDmode
    operand is just too much, the inner mode is lost there.  We'd need some
    new rtx that would be able to represent those cases.
    For now, just punt in those cases.

    2022-02-17  Jakub Jelinek  <jakub@redhat.com>

            PR debug/104557
            * valtrack.c (debug_lowpart_subreg): Don't call gen_rtx_raw_SUBREG
            if expr has VOIDmode.

            * gcc.dg/dfp/pr104557.c: New test.

    (cherry picked from commit 1c2b44b52364cb5661095b346de794bc7ff02866)

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

end of thread, other threads:[~2022-05-11  6:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 20:16 [Bug debug/104557] New: [12 Regression] ICE: in simplify_subreg, at simplify-rtx.cc:7324 with -O -g zsojka at seznam dot cz
2022-02-15 23:39 ` [Bug debug/104557] " pinskia at gcc dot gnu.org
2022-02-16  9:46 ` jakub at gcc dot gnu.org
2022-02-16 10:57 ` jakub at gcc dot gnu.org
2022-02-17 10:15 ` cvs-commit at gcc dot gnu.org
2022-02-17 10:18 ` jakub at gcc dot gnu.org
2022-02-19  8:03 ` cvs-commit at gcc dot gnu.org
2022-05-10  8:24 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:25 ` 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).