public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1
@ 2022-04-10 19:51 roland.illig at gmx dot de
  2022-04-11  7:29 ` [Bug target/105209] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: roland.illig at gmx dot de @ 2022-04-10 19:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105209
           Summary: internal compiler error: in store_data_bypass_p_1
           Product: gcc
           Version: 10.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roland.illig at gmx dot de
  Target Milestone: ---
            Target: alpha

$ cat <<'EOF' > tree.c
typedef struct tnode_t {
        struct tnode_t *tn_left, *tn_right;
        int v_quad;
} tnode_t;

int constant_addr(const tnode_t *, long *);
int constant_addr(const tnode_t *tn, long *offsp)
{
        long offs1 = 0, offs2 = 0;

        if (tn->v_quad > 0) {
                offs1 = tn->v_quad;
                return 0;
        } else if (tn->v_quad > -1) {
                offs2 = tn->tn_right->v_quad;
                if (!constant_addr(tn->tn_left, &offs1))
                        return 0;
        } else {
                return 0;
        }
        *offsp = offs1 + offs2;
        return 1;
}
EOF

$ /home/rillig/builds/alpha-tools/bin/alpha--netbsd-gcc -O2 -ftrapv -c tree.c
during RTL pass: sched1
/home/rillig/proj/src/usr.bin/xlint/lint1/tree.c: In function 'constant_addr':
/home/rillig/proj/src/usr.bin/xlint/lint1/tree.c:23:1: internal compiler error:
in store_data_bypass_p_1, at recog.c:3714
   23 | }
      | ^

$ gcc --version
alpha--netbsd-gcc (NetBSD nb1 20210411) 10.3.0

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
@ 2022-04-11  7:29 ` rguenth at gcc dot gnu.org
  2022-04-11 11:48 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-11  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |10.3.1, 12.0
   Last reconfirmed|                            |2022-04-11
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

(gdb) p debug_rtx (out_insn)
(insn 37 36 38 5 (parallel [
            (set (reg:DI 93)
                (plus:DI (reg:DI 71 [ _3 ])
                    (reg:DI 82 [ _25 ])))
            (trap_if (ne (plus:TI (sign_extend:TI (reg:DI 71 [ _3 ]))
                        (sign_extend:TI (reg:DI 82 [ _25 ])))
                    (sign_extend:TI (plus:DI (reg:DI 71 [ _3 ])
                            (reg:DI 82 [ _25 ]))))
                (const_int 0 [0]))
        ]) "t.c":21:24 13 {addvdi3}
     (expr_list:REG_DEAD (reg:DI 82 [ _25 ])
        (expr_list:REG_DEAD (reg:DI 71 [ _3 ])
            (nil))))

looks like store_data_bypass_p_1 does not handle trap_if in PATTERN.

#1  0x000000000124c228 in store_data_bypass_p_1 (out_insn=0x7ffff6522980, 
    in_set=0x7ffff663d948) at /home/rguenther/src/trunk/gcc/recog.cc:4233
#2  0x000000000124c29e in store_data_bypass_p (out_insn=0x7ffff6522980, 
    in_insn=0x7ffff65229c0) at /home/rguenther/src/trunk/gcc/recog.cc:4251
#3  0x0000000001ddc520 in internal_insn_latency (insn_code=9, insn2_code=2, 
    insn=0x7ffff6522980, insn2=0x7ffff65229c0) at insn-automata.cc:3171
#4  0x0000000001ddc9a4 in insn_latency (insn=0x7ffff6522980, 
    insn2=0x7ffff65229c0) at insn-automata.cc:3382
#5  0x0000000001f5aec9 in dep_cost_1 (link=0x2d8af28, dw=0)
    at /home/rguenther/src/trunk/gcc/haifa-sched.cc:1488
#6  0x0000000001f5af4e in dep_cost (link=0x2d8af28)
    at /home/rguenther/src/trunk/gcc/haifa-sched.cc:1510
#7  0x0000000001f5b46a in priority (insn=0x7ffff6522980, force_recompute=false)
    at /home/rguenther/src/trunk/gcc/haifa-sched.cc:1661
#8  0x0000000001f6871d in set_priorities (head=0x7ffff6522900, 
    tail=0x7ffff65223c0) at /home/rguenther/src/trunk/gcc/haifa-sched.cc:7166
#9  0x00000000012b9868 in compute_priorities ()
    at /home/rguenther/src/trunk/gcc/sched-rgn.cc:3025

note that this is likely an error in the alpha machine description which
uses store_data_bypass_p in the ev4 pipeline description and wrongly(?)
tags addvsi3 with such part of the pipeline.

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
  2022-04-11  7:29 ` [Bug target/105209] " rguenth at gcc dot gnu.org
@ 2022-04-11 11:48 ` ubizjak at gmail dot com
  2022-06-17 15:21 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2022-04-11 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 52780
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52780&action=edit
Proposed patch

This patch introduces alpha-specific version of store_data_bypass_p that
ignores TRAP_IF that would result in assertion failure (and internal compiler
error)
in the generic store_data_bypass_p function.

While at it, also remove ev4_ist_c reservation, store_data_bypass_p can handle
the patterns with multiple sets since some time ago.

The patch is only compile tested, someone should at least bootstrap and
regression test it on alpha target.

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
  2022-04-11  7:29 ` [Bug target/105209] " rguenth at gcc dot gnu.org
  2022-04-11 11:48 ` ubizjak at gmail dot com
@ 2022-06-17 15:21 ` cvs-commit at gcc dot gnu.org
  2022-06-20 18:47 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-17 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r13-1157-gcc378e655740e93743e7f43e14faaff707aef6c1
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri Jun 17 17:19:44 2022 +0200

    alpha: Introduce target specific store_data_bypass_p function [PR105209]

    This patch introduces alpha-specific version of store_data_bypass_p that
    ignores TRAP_IF that would result in assertion failure (and internal
    compiler error) in the generic store_data_bypass_p function.

    While at it, also remove ev4_ist_c reservation, store_data_bypass_p
    can handle the patterns with multiple sets since some time ago.

    2022-06-17  Uroš Bizjak  <ubizjak@gmail.com>

    gcc/ChangeLog:

            PR target/105209
            * config/alpha/alpha-protos.h (alpha_store_data_bypass_p): New.
            * config/alpha/alpha.cc (alpha_store_data_bypass_p): New function.
            (alpha_store_data_bypass_p_1): Ditto.
            * config/alpha/ev4.md: Use alpha_store_data_bypass_p instead
            of generic store_data_bypass_p.
            (ev4_ist_c): Remove insn reservation.

    gcc/testsuite/ChangeLog:

            PR target/105209
            * gcc.target/alpha/pr105209.c: New test.

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
                   ` (2 preceding siblings ...)
  2022-06-17 15:21 ` cvs-commit at gcc dot gnu.org
@ 2022-06-20 18:47 ` cvs-commit at gcc dot gnu.org
  2022-06-20 20:46 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-20 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

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

commit r12-8499-gf8fc8a6ff7a6996fb7f12338c45d1c3450b7a397
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri Jun 17 17:19:44 2022 +0200

    alpha: Introduce target specific store_data_bypass_p function [PR105209]

    This patch introduces alpha-specific version of store_data_bypass_p that
    ignores TRAP_IF that would result in assertion failure (and internal
    compiler error) in the generic store_data_bypass_p function.

    While at it, also remove ev4_ist_c reservation, store_data_bypass_p
    can handle the patterns with multiple sets since some time ago.

    2022-06-17  Uroš Bizjak  <ubizjak@gmail.com>

    gcc/ChangeLog:

            PR target/105209
            * config/alpha/alpha-protos.h (alpha_store_data_bypass_p): New.
            * config/alpha/alpha.cc (alpha_store_data_bypass_p): New function.
            (alpha_store_data_bypass_p_1): Ditto.
            * config/alpha/ev4.md: Use alpha_store_data_bypass_p instead
            of generic store_data_bypass_p.
            (ev4_ist_c): Remove insn reservation.

    gcc/testsuite/ChangeLog:

            PR target/105209
            * gcc.target/alpha/pr105209.c: New test.

    (cherry picked from commit cc378e655740e93743e7f43e14faaff707aef6c1)

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
                   ` (3 preceding siblings ...)
  2022-06-20 18:47 ` cvs-commit at gcc dot gnu.org
@ 2022-06-20 20:46 ` cvs-commit at gcc dot gnu.org
  2022-06-20 20:53 ` cvs-commit at gcc dot gnu.org
  2022-06-20 20:54 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-20 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:380829dfd9d8a602322a7771f94616056ebbde21

commit r11-10085-g380829dfd9d8a602322a7771f94616056ebbde21
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri Jun 17 17:19:44 2022 +0200

    alpha: Introduce target specific store_data_bypass_p function [PR105209]

    This patch introduces alpha-specific version of store_data_bypass_p that
    ignores TRAP_IF that would result in assertion failure (and internal
    compiler error) in the generic store_data_bypass_p function.

    While at it, also remove ev4_ist_c reservation, store_data_bypass_p
    can handle the patterns with multiple sets since some time ago.

    2022-06-17  Uroš Bizjak  <ubizjak@gmail.com>

    gcc/ChangeLog:

            PR target/105209
            * config/alpha/alpha-protos.h (alpha_store_data_bypass_p): New.
            * config/alpha/alpha.c (alpha_store_data_bypass_p): New function.
            (alpha_store_data_bypass_p_1): Ditto.
            * config/alpha/ev4.md: Use alpha_store_data_bypass_p instead
            of generic store_data_bypass_p.
            (ev4_ist_c): Remove insn reservation.

    gcc/testsuite/ChangeLog:

            PR target/105209
            * gcc.target/alpha/pr105209.c: New test.

    (cherry picked from commit cc378e655740e93743e7f43e14faaff707aef6c1)

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
                   ` (4 preceding siblings ...)
  2022-06-20 20:46 ` cvs-commit at gcc dot gnu.org
@ 2022-06-20 20:53 ` cvs-commit at gcc dot gnu.org
  2022-06-20 20:54 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-20 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:94cf9bfb4d269fa5a4e3eeda45f4eafe392bfd58

commit r10-10861-g94cf9bfb4d269fa5a4e3eeda45f4eafe392bfd58
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Fri Jun 17 17:19:44 2022 +0200

    alpha: Introduce target specific store_data_bypass_p function [PR105209]

    This patch introduces alpha-specific version of store_data_bypass_p that
    ignores TRAP_IF that would result in assertion failure (and internal
    compiler error) in the generic store_data_bypass_p function.

    While at it, also remove ev4_ist_c reservation, store_data_bypass_p
    can handle the patterns with multiple sets since some time ago.

    2022-06-17  Uroš Bizjak  <ubizjak@gmail.com>

    gcc/ChangeLog:

            PR target/105209
            * config/alpha/alpha-protos.h (alpha_store_data_bypass_p): New.
            * config/alpha/alpha.c (alpha_store_data_bypass_p): New function.
            (alpha_store_data_bypass_p_1): Ditto.
            * config/alpha/ev4.md: Use alpha_store_data_bypass_p instead
            of generic store_data_bypass_p.
            (ev4_ist_c): Remove insn reservation.

    gcc/testsuite/ChangeLog:

            PR target/105209
            * gcc.target/alpha/pr105209.c: New test.

    (cherry picked from commit cc378e655740e93743e7f43e14faaff707aef6c1)

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

* [Bug target/105209] internal compiler error: in store_data_bypass_p_1
  2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
                   ` (5 preceding siblings ...)
  2022-06-20 20:53 ` cvs-commit at gcc dot gnu.org
@ 2022-06-20 20:54 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2022-06-20 20:54 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com
         Resolution|---                         |FIXED
   Target Milestone|---                         |10.4

--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed for gcc-10.4+

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

end of thread, other threads:[~2022-06-20 20:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10 19:51 [Bug c/105209] New: internal compiler error: in store_data_bypass_p_1 roland.illig at gmx dot de
2022-04-11  7:29 ` [Bug target/105209] " rguenth at gcc dot gnu.org
2022-04-11 11:48 ` ubizjak at gmail dot com
2022-06-17 15:21 ` cvs-commit at gcc dot gnu.org
2022-06-20 18:47 ` cvs-commit at gcc dot gnu.org
2022-06-20 20:46 ` cvs-commit at gcc dot gnu.org
2022-06-20 20:53 ` cvs-commit at gcc dot gnu.org
2022-06-20 20:54 ` ubizjak at gmail 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).