public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
@ 2023-09-20 14:35 jakub at gcc dot gnu.org
  2023-09-20 14:35 ` [Bug middle-end/111497] " jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-20 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111497
           Summary: [11/12/13/14 Regression] ICE building mariadb on i686
                    since r8-470
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

The following testcase ICEs on x86_64-linux with
-m32 -march=i686 -mtune=generic -fPIC -O2 -g
starting with r8-470-g973dfbb4a63ba7c580e4
The error is:
during RTL pass: pro_and_epilogue
item.ii: In constructor ‘G::G(A*, const B&, const B&, const B&)’:
item.ii:19:1: internal compiler error: in find_oldest_value_reg, at
regcprop.cc:465
   19 | }
      | ^
0x10304d0 find_oldest_value_reg
        ../../gcc/regcprop.cc:465
0x10307eb replace_oldest_value_reg
        ../../gcc/regcprop.cc:512
0x1030fe0 replace_oldest_value_addr
        ../../gcc/regcprop.cc:671
0x10311c3 replace_oldest_value_mem
        ../../gcc/regcprop.cc:704
and it is apparently due to LRA leaving a reference to a pseudo register in a
DEBUG_INSN:
(debug_insn 28 27 29 2 (var_location:SI x (mem/f:SI (reg:SI 110) [1
*y_10(D).b1+0 S4 A32])) "item.ii":4:39 -1
     (nil))
in *.reload dump and forward.

Vlad, could you please have a look?

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
@ 2023-09-20 14:35 ` jakub at gcc dot gnu.org
  2023-09-20 14:36 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-20 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Priority|P3                          |P2
                 CC|                            |vmakarov at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-09-20
   Target Milestone|---                         |11.5

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
  2023-09-20 14:35 ` [Bug middle-end/111497] " jakub at gcc dot gnu.org
@ 2023-09-20 14:36 ` jakub at gcc dot gnu.org
  2023-09-20 14:41 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-20 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase:
class A;
struct B { const char *b1; int b2; };
struct C : B { C (const char *x, int y) { b1 = x; b2 = y; } };
struct D : C { D (B x) : C (x.b1, x.b2) {} };
struct E { E (A *); };
struct F : E { D f1, f2, f3, f4, f5, f6; F (A *, const B &, const B &, const B
&); };
struct G : F { G (A *, const B &, const B &, const B &); };
struct H { int h; };
struct I { H i; };
struct J { I *j; };
struct A : J {};
inline F::F (A *x, const B &y, const B &z, const B &w)
  : E(x), f1(y), f2(z), f3(w), f4(y), f5(z), f6(w) {}
G::G (A *x, const B &y, const B &z, const B &w) : F(x, y, z, w)
{
  H *h = &x->j->i;
  if (h)
    h->h++;
}

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
  2023-09-20 14:35 ` [Bug middle-end/111497] " jakub at gcc dot gnu.org
  2023-09-20 14:36 ` jakub at gcc dot gnu.org
@ 2023-09-20 14:41 ` jakub at gcc dot gnu.org
  2023-09-20 14:55 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-20 14:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, there are no differences in -fdump-tree-optimized-vops-alias-details
dump, so it might be some glitch in our bisect seed.
The neighboring r8-469-g8ffa3150d30b90a11aba7d7b revision looks much more
related.

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-09-20 14:41 ` jakub at gcc dot gnu.org
@ 2023-09-20 14:55 ` jakub at gcc dot gnu.org
  2023-09-22 19:50 ` vmakarov at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-20 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
When comparing RTL dump files between r247719 and r247721, ira dump is pretty
much the same (just printed compiler pointers in the dump change), while reload
dump has lots of changes including this pseudo in the debug insn.

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-09-20 14:55 ` jakub at gcc dot gnu.org
@ 2023-09-22 19:50 ` vmakarov at gcc dot gnu.org
  2023-09-25 20:20 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2023-09-22 19:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
I've reproduced the bug. The problem is in combination of splitting pseudo live
range and sharing rtl.

I hope to fix this on the next Monday or Tuesday.

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-09-22 19:50 ` vmakarov at gcc dot gnu.org
@ 2023-09-25 20:20 ` cvs-commit at gcc dot gnu.org
  2023-11-13 16:17 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-25 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vladimir Makarov <vmakarov@gcc.gnu.org>:

https://gcc.gnu.org/g:3c23defed384cf17518ad6c817d94463a445d21b

commit r14-4256-g3c23defed384cf17518ad6c817d94463a445d21b
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Mon Sep 25 16:19:50 2023 -0400

    [PR111497][LRA]: Copy substituted equivalence

    When we substitute the equivalence and it becomes shared, we can fail
    to correctly update reg info used by LRA.  This can result in wrong
    code generation, e.g. because of incorrect live analysis.  It can also
    result in compiler crash as the pseudo survives RA.  This is what
    exactly happened for the PR.  This patch solves this problem by
    unsharing substituted equivalences.

    gcc/ChangeLog:

            PR middle-end/111497
            * lra-constraints.cc (lra_constraints): Copy substituted
            equivalence.
            * lra.cc (lra): Change comment for calling unshare_all_rtl_again.

    gcc/testsuite/ChangeLog:

            PR middle-end/111497
            * g++.target/i386/pr111497.C: new test.

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-09-25 20:20 ` cvs-commit at gcc dot gnu.org
@ 2023-11-13 16:17 ` jakub at gcc dot gnu.org
  2023-11-13 18:27 ` vmakarov at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-13 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Is this backportable to release branches or too risky?

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

* [Bug middle-end/111497] [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-11-13 16:17 ` jakub at gcc dot gnu.org
@ 2023-11-13 18:27 ` vmakarov at gcc dot gnu.org
  2023-11-30  8:23 ` [Bug middle-end/111497] [11/12/13 " rguenth at gcc dot gnu.org
  2023-11-30 11:44 ` cvs-commit at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2023-11-13 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #6)
> Is this backportable to release branches or too risky?

I don't think it is risky.  LRA was designed to have unshared rtl.  So copying
rtl in LRA is not risky.

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

* [Bug middle-end/111497] [11/12/13 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-11-13 18:27 ` vmakarov at gcc dot gnu.org
@ 2023-11-30  8:23 ` rguenth at gcc dot gnu.org
  2023-11-30 11:44 ` cvs-commit at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-30  8:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |14.0
            Summary|[11/12/13/14 Regression]    |[11/12/13 Regression] ICE
                   |ICE building mariadb on     |building mariadb on i686
                   |i686 since r8-470           |since r8-470

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar, will test on the 13 branch now.

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

* [Bug middle-end/111497] [11/12/13 Regression] ICE building mariadb on i686 since r8-470
  2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-11-30  8:23 ` [Bug middle-end/111497] [11/12/13 " rguenth at gcc dot gnu.org
@ 2023-11-30 11:44 ` cvs-commit at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-30 11:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:741743c028dc00f27b9c8b1d5211c1f602f2fddd

commit r13-8109-g741743c028dc00f27b9c8b1d5211c1f602f2fddd
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Mon Sep 25 16:19:50 2023 -0400

    [PR111497][LRA]: Copy substituted equivalence

    When we substitute the equivalence and it becomes shared, we can fail
    to correctly update reg info used by LRA.  This can result in wrong
    code generation, e.g. because of incorrect live analysis.  It can also
    result in compiler crash as the pseudo survives RA.  This is what
    exactly happened for the PR.  This patch solves this problem by
    unsharing substituted equivalences.

    gcc/ChangeLog:

            PR middle-end/111497
            * lra-constraints.cc (lra_constraints): Copy substituted
            equivalence.
            * lra.cc (lra): Change comment for calling unshare_all_rtl_again.

    gcc/testsuite/ChangeLog:

            PR middle-end/111497
            * g++.target/i386/pr111497.C: new test.

    (cherry picked from commit 3c23defed384cf17518ad6c817d94463a445d21b)

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

end of thread, other threads:[~2023-11-30 11:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20 14:35 [Bug middle-end/111497] New: [11/12/13/14 Regression] ICE building mariadb on i686 since r8-470 jakub at gcc dot gnu.org
2023-09-20 14:35 ` [Bug middle-end/111497] " jakub at gcc dot gnu.org
2023-09-20 14:36 ` jakub at gcc dot gnu.org
2023-09-20 14:41 ` jakub at gcc dot gnu.org
2023-09-20 14:55 ` jakub at gcc dot gnu.org
2023-09-22 19:50 ` vmakarov at gcc dot gnu.org
2023-09-25 20:20 ` cvs-commit at gcc dot gnu.org
2023-11-13 16:17 ` jakub at gcc dot gnu.org
2023-11-13 18:27 ` vmakarov at gcc dot gnu.org
2023-11-30  8:23 ` [Bug middle-end/111497] [11/12/13 " rguenth at gcc dot gnu.org
2023-11-30 11:44 ` 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).