public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288
@ 2022-04-12 17:42 slyfox at gcc dot gnu.org
  2022-04-13  5:26 ` [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: slyfox at gcc dot gnu.org @ 2022-04-12 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105247
           Summary: IA64: ICE on sqlite-3.38.2: in decompose, at
                    rtl.h:2288
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---
            Target: ia64-unknown-linux-gnu

Noticed when built sqlite with thsi week's gcc for ia64 target. Extracted
example:

int sqlite3CodeVerifySchemaAtToplevel_pToplevel_0;
void sqlite3CodeVerifySchema();
void sqlite3FindInIndex_pParse() {
  int i = -8;
  sqlite3CodeVerifySchema(sqlite3FindInIndex_pParse, i);
}
void sqlite3CodeVerifySchema(int, int iDb) {
  sqlite3CodeVerifySchemaAtToplevel_pToplevel_0 |= 1 << iDb;
}

$ ia64-unknown-linux-gnu-gcc -O1 -c sqlite3-sqlite3.o.c -o a.o
during RTL pass: cse1
sqlite3-sqlite3.o.c: In function 'sqlite3FindInIndex_pParse':
sqlite3-sqlite3.o.c:7:1: internal compiler error: in decompose, at rtl.h:2288
    7 | }
      | ^
0xa02263 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long*,
unsigned int, std::pair<rtx_def*, machine_mode> const&)
        ../../gcc-12-20220410/gcc/rtl.h:2288
0xa02263 wide_int_ref_storage<false,
false>::wide_int_ref_storage<std::pair<rtx_def*, machine_mode>
>(std::pair<rtx_def*, machine_mode> const&)
        ../../gcc-12-20220410/gcc/wide-int.h:1024
0xa02263 generic_wide_int<wide_int_ref_storage<false, false>
>::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&)
        ../../gcc-12-20220410/gcc/wide-int.h:782
0xa02263 wide_int_storage::wide_int_storage<std::pair<rtx_def*, machine_mode>
>(std::pair<rtx_def*, machine_mode> const&)
        ../../gcc-12-20220410/gcc/wide-int.h:1115
0xdc9c5b
generic_wide_int<wide_int_storage>::generic_wide_int<std::pair<rtx_def*,
machine_mode> >(std::pair<rtx_def*, machine_mode> const&)
        ../../gcc-12-20220410/gcc/wide-int.h:782
0xdc9c5b simplify_const_binary_operation(rtx_code, machine_mode, rtx_def*,
rtx_def*)
        ../../gcc-12-20220410/gcc/simplify-rtx.cc:5069
0xdd19f8 simplify_context::simplify_binary_operation(rtx_code, machine_mode,
rtx_def*, rtx_def*)
        ../../gcc-12-20220410/gcc/simplify-rtx.cc:2569
0x15a2294 simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
        ../../gcc-12-20220410/gcc/rtl.h:3475
0x15a2294 fold_rtx
        ../../gcc-12-20220410/gcc/cse.cc:3720
0x15a39f0 cse_insn
        ../../gcc-12-20220410/gcc/cse.cc:4669
0x15a894f cse_extended_basic_block
        ../../gcc-12-20220410/gcc/cse.cc:6566
0x15a894f cse_main
        ../../gcc-12-20220410/gcc/cse.cc:6711
0x15a97e6 rest_of_handle_cse
        ../../gcc-12-20220410/gcc/cse.cc:7532
0x15a97e6 execute
        ../../gcc-12-20220410/gcc/cse.cc:7575

$ ia64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/<<NIX>>/ia64-unknown-linux-gnu-stage-final-gcc-debug-12.0.0/bin/ia64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/<<NIX>>/ia64-unknown-linux-gnu-stage-final-gcc-debug-12.0.0/libexec/gcc/ia64-unknown-linux-gnu/12.0.1/lto-wrapper
Target: ia64-unknown-linux-gnu
Configured with:
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220410 (experimental) (GCC)

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

* [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
@ 2022-04-13  5:26 ` marxin at gcc dot gnu.org
  2022-04-13  5:26 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-04-13  5:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|IA64: ICE on sqlite-3.38.2: |[11/12 Regression] IA64:
                   |in decompose, at rtl.h:2288 |ICE on sqlite-3.38.2: in
                   |                            |decompose, at rtl.h:2288
                   |                            |since
                   |                            |r11-5271-g4866b2f5db117f
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2022-04-13
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-5271-g4866b2f5db117f.

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

* [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
  2022-04-13  5:26 ` [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f marxin at gcc dot gnu.org
@ 2022-04-13  5:26 ` marxin at gcc dot gnu.org
  2022-04-13  6:37 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-04-13  5:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.3

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

* [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
  2022-04-13  5:26 ` [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f marxin at gcc dot gnu.org
  2022-04-13  5:26 ` marxin at gcc dot gnu.org
@ 2022-04-13  6:37 ` rguenth at gcc dot gnu.org
  2022-04-13 11:11 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-13  6:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
note that 1 << -8 invokes undefined behavior at runtime (but it's still valid
code so we shouldn't ICE).

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

* [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-04-13  6:37 ` rguenth at gcc dot gnu.org
@ 2022-04-13 11:11 ` jakub at gcc dot gnu.org
  2022-04-13 11:17 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-13 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The problem is that the ia64 backend for some strange reason uses DImode for
the
shift last operands, while e.g. in GIMPLE they are converted to
integer_type_node or so:
      /* Why oh why didn't Intel arrange for SHIFT_COUNT_TRUNCATED?  Now
         we've got to get rid of stray bits outside the SImode register.  */
      rtx subshift = gen_reg_rtx (DImode);
      emit_insn (gen_zero_extendsidi2 (subshift, operands[2]));
      operands[2] = subshift;
and simplify-rtx.cc simply uses the mode of the shift for the shift count.

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

* [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-04-13 11:11 ` jakub at gcc dot gnu.org
@ 2022-04-13 11:17 ` jakub at gcc dot gnu.org
  2022-04-14 11:48 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-13 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

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 #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52797
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52797&action=edit
gcc12-pr105247.patch

Untested fix.

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

* [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-04-13 11:17 ` jakub at gcc dot gnu.org
@ 2022-04-14 11:48 ` cvs-commit at gcc dot gnu.org
  2022-04-14 12:02 ` [Bug target/105247] [11 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-14 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:ba2f60499dd4a3bc1bb4e99fa12dda3bc1548519

commit r12-8158-gba2f60499dd4a3bc1bb4e99fa12dda3bc1548519
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Apr 14 13:47:34 2022 +0200

    simplify-rtx: Don't assume shift count has the same mode as the shift
[PR105247]

    The following testcase ICEs on ia64.  It is UB at runtime, but we shouldn't
    ICE on it...
    The problem is that on ia64, the shift count (last operand of ASHIFT etc.)
    is promoted to DImode (using zero-extension), while most other targets
    use much narrower modes (say QImode).  If we try to simplify a shift
    and the shift count is CONST_INT or other VOIDmode integer constant
    which isn't properly sign extended for the first operand's mode
    (in the testcase the shift count is 0xfffffff8U and it is a SImode shift),
    then we ICE during wide_int wop1 = pop1; in the first hunk, INTVAL ==
0xfffffff8U
    is not valid for SImode.  I think in theory we could run into this even
    on other targets, say if they use SImode or HImode shift counts for e.g.
    QImode shifts.  I hope word size is the upper bound of what a reasonable
    target should use, using e.g. multiple registers for the shift count is
    insane, so the following patch if op1 has VOIDmode and int_mode
    is narrower than word uses word_mode for extraction of the value.

    2022-04-14  Jakub Jelinek  <jakub@redhat.com>

            PR target/105247
            * simplify-rtx.cc (simplify_const_binary_operation): For shifts
            or rotates by VOIDmode constant integer shift count use word_mode
            for the operand if int_mode is narrower than word.

            * gcc.c-torture/compile/pr105247.c: New test.

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

* [Bug target/105247] [11 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-04-14 11:48 ` cvs-commit at gcc dot gnu.org
@ 2022-04-14 12:02 ` jakub at gcc dot gnu.org
  2022-04-21  7:51 ` rguenth at gcc dot gnu.org
  2023-05-29 10:06 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-14 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11/12 Regression] IA64:    |[11 Regression] IA64: ICE
                   |ICE on sqlite-3.38.2: in    |on sqlite-3.38.2: in
                   |decompose, at rtl.h:2288    |decompose, at rtl.h:2288
                   |since                       |since
                   |r11-5271-g4866b2f5db117f    |r11-5271-g4866b2f5db117f

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

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

* [Bug target/105247] [11 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-04-14 12:02 ` [Bug target/105247] [11 " jakub at gcc dot gnu.org
@ 2022-04-21  7:51 ` rguenth at gcc dot gnu.org
  2023-05-29 10:06 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-21  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.3                        |11.4

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.3 is being released, retargeting bugs to GCC 11.4.

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

* [Bug target/105247] [11 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f
  2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-04-21  7:51 ` rguenth at gcc dot gnu.org
@ 2023-05-29 10:06 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

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

end of thread, other threads:[~2023-05-29 10:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 17:42 [Bug target/105247] New: IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 slyfox at gcc dot gnu.org
2022-04-13  5:26 ` [Bug target/105247] [11/12 Regression] IA64: ICE on sqlite-3.38.2: in decompose, at rtl.h:2288 since r11-5271-g4866b2f5db117f marxin at gcc dot gnu.org
2022-04-13  5:26 ` marxin at gcc dot gnu.org
2022-04-13  6:37 ` rguenth at gcc dot gnu.org
2022-04-13 11:11 ` jakub at gcc dot gnu.org
2022-04-13 11:17 ` jakub at gcc dot gnu.org
2022-04-14 11:48 ` cvs-commit at gcc dot gnu.org
2022-04-14 12:02 ` [Bug target/105247] [11 " jakub at gcc dot gnu.org
2022-04-21  7:51 ` rguenth at gcc dot gnu.org
2023-05-29 10:06 ` 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).