public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106481] New: [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop
@ 2022-07-30  6:36 zsojka at seznam dot cz
  2022-07-30  8:15 ` [Bug target/106481] " roger at nextmovesoftware dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2022-07-30  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106481
           Summary: [13 Regression] ICE: in native_encode_rtx, at
                    simplify-rtx.cc:6884 with -O2 -fno-dce
                    -fno-forward-propagate -fno-rerun-cse-after-loop
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          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 53387
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53387&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-dce -fno-forward-propagate
-fno-rerun-cse-after-loop testcase.c -Wno-psabi
testcase.c:13:1: internal compiler error: in native_encode_rtx, at
simplify-rtx.cc:6884
   13 | }
      | ^
0x7857b6 native_encode_rtx(machine_mode, rtx_def*, vec<unsigned char, va_heap,
vl_ptr>&, unsigned int, unsigned int)
        /repo/gcc-trunk/gcc/simplify-rtx.cc:6884
0x16f2feb optimize_constant_pool
        /repo/gcc-trunk/gcc/varasm.cc:4437
0x16fcbff output_shared_constant_pool()
        /repo/gcc-trunk/gcc/varasm.cc:4544
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-r13-1895-20220729130134-g6e0ca3fe88d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.0.0/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
--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-r13-1895-20220729130134-g6e0ca3fe88d-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20220729 (experimental) (GCC)

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

* [Bug target/106481] [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop
  2022-07-30  6:36 [Bug target/106481] New: [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop zsojka at seznam dot cz
@ 2022-07-30  8:15 ` roger at nextmovesoftware dot com
  2022-08-01 10:26 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-07-30  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
   Last reconfirmed|                            |2022-07-30
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |roger at nextmovesoftware dot com
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |roger at nextmovesoftware dot com

--- Comment #1 from Roger Sayle <roger at nextmovesoftware dot com> ---
More TImode STV fallout.  This time with REG_EQUAL notes containing VOIDmode
(implicitly TImode) const_wide_int not being converted to explicit V1TImode
const_vector.  I'm bootstrapping and regression testing a fix.
[Thanks again to Zdenek]

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

* [Bug target/106481] [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop
  2022-07-30  6:36 [Bug target/106481] New: [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop zsojka at seznam dot cz
  2022-07-30  8:15 ` [Bug target/106481] " roger at nextmovesoftware dot com
@ 2022-08-01 10:26 ` marxin at gcc dot gnu.org
  2022-08-01 22:09 ` cvs-commit at gcc dot gnu.org
  2022-08-03  7:41 ` roger at nextmovesoftware dot com
  3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-08-01 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Btw. started with r13-1607-gc3ed9e0d6e96d869.

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

* [Bug target/106481] [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop
  2022-07-30  6:36 [Bug target/106481] New: [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop zsojka at seznam dot cz
  2022-07-30  8:15 ` [Bug target/106481] " roger at nextmovesoftware dot com
  2022-08-01 10:26 ` marxin at gcc dot gnu.org
@ 2022-08-01 22:09 ` cvs-commit at gcc dot gnu.org
  2022-08-03  7:41 ` roger at nextmovesoftware dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-08-01 22:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:96e5f6696a1fa90493c464884984e9f1de86d817

commit r13-1920-g96e5f6696a1fa90493c464884984e9f1de86d817
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Mon Aug 1 23:08:23 2022 +0100

    PR target/106481: Handle CONST_WIDE_INT in REG_EQUAL during STV on x86_64.

    This patch resolves PR target/106481, and is an oversight in my recent
    battles with REG_EQUAL notes during TImode STV (see PR target/106278
    https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598416.html).

    The patch above's/current behaviour is that we check that the mode of
    the REG_EQUAL note is TImode before using PUT_MODE to set it to V1TImode.
    However, the new test case reveals that this doesn't consider REG_EQUAL
    notes that are CONST_INT or CONST_WIDE_INT, i.e. that are VOIDmode,
    and so STV produces:

    (insn 85 84 86 2 (set (reg:V1TI 113)
            (reg:V1TI 84)) "pr106481.c":13:3 1766 {movv1ti_internal}
         (expr_list:REG_EQUAL (const_wide_int 0x0ffffffff00000004)
            (nil)))

    which causes problems as the const_wide_int isn't a valid immediate
    constant for V1TImode.  With this patch, we now generate the correct:

    (insn 85 84 86 2 (set (reg:V1TI 113)
            (reg:V1TI 84)) "pr106481.c":13:3 1766 {movv1ti_internal}
         (expr_list:REG_EQUAL (const_vector:V1TI [
                    (const_wide_int 0x0ffffffff00000004)
                ])
            (nil)))

    2022-08-01  Roger Sayle  <roger@nextmovesoftware.com>
                Uroš Bizjak  <ubizjak@gmail.com>

    gcc/ChangeLog
            PR target/106481
            * config/i386/i386-features.cc (timode_scalar_chain::convert_insn):
            Convert a CONST_SCALAR_INT_P in a REG_EQUAL note into a V1TImode
            CONST_VECTOR.

    gcc/testsuite/ChangeLog
            PR target/106481
            * gcc.target/i386/pr106481.c: New test case.

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

* [Bug target/106481] [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop
  2022-07-30  6:36 [Bug target/106481] New: [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-08-01 22:09 ` cvs-commit at gcc dot gnu.org
@ 2022-08-03  7:41 ` roger at nextmovesoftware dot com
  3 siblings, 0 replies; 5+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-08-03  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

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

--- Comment #4 from Roger Sayle <roger at nextmovesoftware dot com> ---
This should now be fixed on mainline.

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

end of thread, other threads:[~2022-08-03  7:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30  6:36 [Bug target/106481] New: [13 Regression] ICE: in native_encode_rtx, at simplify-rtx.cc:6884 with -O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop zsojka at seznam dot cz
2022-07-30  8:15 ` [Bug target/106481] " roger at nextmovesoftware dot com
2022-08-01 10:26 ` marxin at gcc dot gnu.org
2022-08-01 22:09 ` cvs-commit at gcc dot gnu.org
2022-08-03  7:41 ` roger at nextmovesoftware dot com

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).