public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
@ 2020-09-01  7:18 marxin at gcc dot gnu.org
  2020-09-01  8:40 ` [Bug target/96879] " jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-09-01  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96879
           Summary: [11 Regresssion] ICE in native_encode_rtx, at
                    simplify-rtx.c:6482
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: ktkachov at gcc dot gnu.org, rsandifo at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: aarch64-linux-gnu

Must be a recent regression:

aarch64-linux-gnu-gcc
/home/marxin/Programming/gcc/gcc/testsuite/g++.old-deja/g++.other/crash11.C
-mabi=ilp32 -O1 -c
/home/marxin/Programming/gcc/gcc/testsuite/g++.old-deja/g++.other/crash11.C:21:30:
internal compiler error: in native_encode_rtx, at simplify-rtx.c:6482
   21 | template struct string <char>;
      |                              ^
0x67af49 native_encode_rtx(machine_mode, rtx_def*, vec<unsigned char, va_heap,
vl_ptr>&, unsigned int, unsigned int)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/simplify-rtx.c:6482
0xf3ecea optimize_constant_pool
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/varasm.c:4324
0xf43928 output_shared_constant_pool()
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-aarch64/build/gcc/varasm.c:4431
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.

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
@ 2020-09-01  8:40 ` jakub at gcc dot gnu.org
  2020-09-01  8:40 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-01  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is an aarch64 backend bug (I needed -fno-section-anchors to trigger
though).
aarch64_expand_mov_immediate has:
        case SYMBOL_FORCE_TO_MEM:
          if (const_offset != 0
              && targetm.cannot_force_const_mem (int_mode, imm))
            {
              gcc_assert (can_create_pseudo_p ());
              base = aarch64_force_temporary (int_mode, dest, base);
              aarch64_add_offset (int_mode, dest, base, const_offset,
                                  NULL_RTX, NULL_RTX, false);
              return;
            }

          mem = force_const_mem (ptr_mode, imm);
          gcc_assert (mem);
and is called with int_mode DImode and imm is a DImode SYMBOL_REF.  As ptr_mode
is SImode, the call to force_const_mem is invalid:
/* Given a constant rtx X, make (or find) a memory constant for its value
   and return a MEM rtx to refer to it in memory.  IN_MODE is the mode
   of X.  */
In particular, IN_MODE is not the mode of X in this case (the reason for the
mode is only for the case of VOIDmode constants).
So, either force_const_mem should be called with lowpart_subreg of imm if
ptr_mode != int_mode, or it should be called with int_mode instead of ptr_mode
and then the later ZERO_EXTEND should not be done.
As it seems before my constant pool optimizations such bogus constant pool
entry assembled into .word the_immediate, doing a lowpart subreg is probably
the right way to go.
So perhaps:
--- gcc/config/aarch64/aarch64.c.jj     2020-08-24 10:00:01.299258763 +0200
+++ gcc/config/aarch64/aarch64.c        2020-09-01 10:34:50.096468522 +0200
@@ -5131,6 +5131,7 @@ aarch64_expand_mov_immediate (rtx dest,
              return;
            }

+         imm = lowpart_subreg (ptr_mode, imm, int_mode);
          mem = force_const_mem (ptr_mode, imm);
          gcc_assert (mem);

except I don't know if it will handle the (const:DI (symbol_ref:DI whatever)
(const_int 32)) case properly.
Also, few lines above this the targetm.cannot_force_const_mem call using
int_mode rather than ptr_mode when it later uses ptr_mode is kind of weird.

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
  2020-09-01  8:40 ` [Bug target/96879] " jakub at gcc dot gnu.org
@ 2020-09-01  8:40 ` jakub at gcc dot gnu.org
  2020-10-02  7:23 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-09-01  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|10.0                        |11.0
   Target Milestone|---                         |11.0

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
  2020-09-01  8:40 ` [Bug target/96879] " jakub at gcc dot gnu.org
  2020-09-01  8:40 ` jakub at gcc dot gnu.org
@ 2020-10-02  7:23 ` marxin at gcc dot gnu.org
  2020-10-02  7:23 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-02  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Any progress on this. Are you planning Jakub to suggest the patch?

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-10-02  7:23 ` marxin at gcc dot gnu.org
@ 2020-10-02  7:23 ` marxin at gcc dot gnu.org
  2020-10-13  7:38 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-02  7:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-10-02
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-10-02  7:23 ` marxin at gcc dot gnu.org
@ 2020-10-13  7:38 ` marxin at gcc dot gnu.org
  2020-10-13  7:48 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-13  7:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
@Jakub: PING

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-10-13  7:38 ` marxin at gcc dot gnu.org
@ 2020-10-13  7:48 ` jakub at gcc dot gnu.org
  2020-10-13 16:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-13  7:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I was hoping the aarch64 maintainers would have a look, because the above patch
is just to show the problem, there are other issues lurking in that area as
written.

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-10-13  7:48 ` jakub at gcc dot gnu.org
@ 2020-10-13 16:48 ` jakub at gcc dot gnu.org
  2020-10-26 16:05 ` rsandifo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-10-13 16:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
lowpart_subreg will not handle CONST the way we'd need (it will just wrap the
CONST into a SUBREG), but the question is if such imm rtxes can make it through
there, because if the offset is non-constant or non-zero, we don't get to this
path, it is only for the zero path.
If strip_offset_and_salt returns a SYMBOL_REF or LABEL_REF, then
aarch64_cannot_force_const_mem should return false for imt_mode != ptr_mode.
The question is what other constants can make it through, is that just
CONST_INTs etc. (i.e. not CONST)?

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-10-13 16:48 ` jakub at gcc dot gnu.org
@ 2020-10-26 16:05 ` rsandifo at gcc dot gnu.org
  2021-03-11  8:29 ` jakub at gcc dot gnu.org
  2021-03-29 11:47 ` rsandifo at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2020-10-26 16:05 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> I was hoping the aarch64 maintainers would have a look, because the above
> patch is just to show the problem, there are other issues lurking in that
> area as written.
I'm hoping to get to this in stage 3.  (Too much stage 1 stuff to finish
off first. :-))

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2020-10-26 16:05 ` rsandifo at gcc dot gnu.org
@ 2021-03-11  8:29 ` jakub at gcc dot gnu.org
  2021-03-29 11:47 ` rsandifo at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-11  8:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Stage 3 is over.  Any progress on this?

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

* [Bug target/96879] [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482
  2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-03-11  8:29 ` jakub at gcc dot gnu.org
@ 2021-03-29 11:47 ` rsandifo at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-03-29 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #8 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Turns out to be the same problem as the later PR97269.

*** This bug has been marked as a duplicate of bug 97269 ***

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

end of thread, other threads:[~2021-03-29 11:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01  7:18 [Bug target/96879] New: [11 Regresssion] ICE in native_encode_rtx, at simplify-rtx.c:6482 marxin at gcc dot gnu.org
2020-09-01  8:40 ` [Bug target/96879] " jakub at gcc dot gnu.org
2020-09-01  8:40 ` jakub at gcc dot gnu.org
2020-10-02  7:23 ` marxin at gcc dot gnu.org
2020-10-02  7:23 ` marxin at gcc dot gnu.org
2020-10-13  7:38 ` marxin at gcc dot gnu.org
2020-10-13  7:48 ` jakub at gcc dot gnu.org
2020-10-13 16:48 ` jakub at gcc dot gnu.org
2020-10-26 16:05 ` rsandifo at gcc dot gnu.org
2021-03-11  8:29 ` jakub at gcc dot gnu.org
2021-03-29 11:47 ` rsandifo 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).