public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
@ 2024-01-02 15:48 doko at gcc dot gnu.org
  2024-01-02 21:39 ` [Bug tree-optimization/113201] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: doko at gcc dot gnu.org @ 2024-01-02 15:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113201
           Summary: [14 Regression] internal compiler error: tree check:
                    expected ssa_name, have integer_cst in
                    replace_uses_by, at tree-cfg.cc:2058
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

seen with trunk 20240101 on x86_64-linux-gnu, building the
xserver-xorg-video-intel package:

fails with -O1, works with -O0. The unreduced testcase didn't work with -O2
either, the reduced test case works with -O2

$ cat sna_accel.i
void __sigsetjmp();
void kgem_add_reloc() {
  int bh;
  __sigsetjmp();
  while (--bh)
    ;
  kgem_add_reloc();
}

$ gcc -c -O1 sna_accel.i
during GIMPLE pass: sccp
sna_accel.i: In function 'kgem_add_reloc':
sna_accel.i:2:6: internal compiler error: tree check: expected ssa_name, have
integer_cst in replace_uses_by, at tree-cfg.cc:2058
    2 | void kgem_add_reloc() {
      |      ^~~~~~~~~~~~~~
0x137f737 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../src/gcc/tree.cc:8952
0xbbd284 tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../src/gcc/tree.h:3612
0xbbd284 replace_uses_by(tree_node*, tree_node*)
        ../../src/gcc/tree-cfg.cc:2058
0x1fcbdc6 final_value_replacement_loop(loop*)
        ../../src/gcc/tree-scalar-evolution.cc:3885
0x1f62756 execute
        ../../src/gcc/tree-ssa-loop.cc:410
Please submit a full bug report, with preprocessed source (by using
-freport-bug).

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

* [Bug tree-optimization/113201] [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
  2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
@ 2024-01-02 21:39 ` pinskia at gcc dot gnu.org
  2024-01-02 21:43 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-02 21:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization
   Target Milestone|---                         |14.0

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

* [Bug tree-optimization/113201] [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
  2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
  2024-01-02 21:39 ` [Bug tree-optimization/113201] " pinskia at gcc dot gnu.org
@ 2024-01-02 21:43 ` pinskia at gcc dot gnu.org
  2024-01-03 17:47 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-02 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-01-02

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Here is a testcase that does not depend on the name of the functions:
```
void f(void)  __attribute__((returns_twice));
void g(void);
void h(void) {
  int bh;
  f();
  while (--bh)
    ;
  g();
}
```

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

* [Bug tree-optimization/113201] [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
  2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
  2024-01-02 21:39 ` [Bug tree-optimization/113201] " pinskia at gcc dot gnu.org
  2024-01-02 21:43 ` pinskia at gcc dot gnu.org
@ 2024-01-03 17:47 ` jakub at gcc dot gnu.org
  2024-01-05 10:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-03 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 56986
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56986&action=edit
gcc14-pr113201.patch

So, do we want just avoid trying to propagate constants to rslt uses if it is
used in abnormal PHI like in this patch, or punt on doing final value
replacement in that case altogether?

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

* [Bug tree-optimization/113201] [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
  2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-01-03 17:47 ` jakub at gcc dot gnu.org
@ 2024-01-05 10:18 ` cvs-commit at gcc dot gnu.org
  2024-01-05 10:19 ` jakub at gcc dot gnu.org
  2024-01-05 14:20 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-05 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC 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:b8faf1fca42a9b987fec0992ca5d63995b2640b3

commit r14-6941-gb8faf1fca42a9b987fec0992ca5d63995b2640b3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 5 11:18:17 2024 +0100

    scev: Avoid ICE on results used in abnormal PHI args [PR113201]

    The following testcase ICEs when rslt is SSA_NAME_OCCURS_IN_ABNORMAL_PHI
    and we call replace_uses_by with a INTEGER_CST def, where it ICEs on:
                  if (e->flags & EDGE_ABNORMAL
                      && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val))
    because val is not an SSA_NAME.  One way would be to add
                      && TREE_CODE (val) == SSA_NAME
    check in between the above 2 lines in replace_uses_by.

    And/or the following patch just punts propagating constants to
    SSA_NAME_OCCURS_IN_ABNORMAL_PHI rslt uses.

    Or we could punt somewhere earlier in final value replacement (but dunno
    where).

    2024-01-05  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113201
            * tree-scalar-evolution.cc (final_value_replacement_loop): Don't
call
            replace_uses_by on SSA_NAME_OCCURS_IN_ABNORMAL_PHI rslt.

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

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

* [Bug tree-optimization/113201] [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
  2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-01-05 10:18 ` cvs-commit at gcc dot gnu.org
@ 2024-01-05 10:19 ` jakub at gcc dot gnu.org
  2024-01-05 14:20 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-05 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.

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

* [Bug tree-optimization/113201] [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058
  2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-01-05 10:19 ` jakub at gcc dot gnu.org
@ 2024-01-05 14:20 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-05 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
.

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

end of thread, other threads:[~2024-01-05 14:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02 15:48 [Bug middle-end/113201] New: [14 Regression] internal compiler error: tree check: expected ssa_name, have integer_cst in replace_uses_by, at tree-cfg.cc:2058 doko at gcc dot gnu.org
2024-01-02 21:39 ` [Bug tree-optimization/113201] " pinskia at gcc dot gnu.org
2024-01-02 21:43 ` pinskia at gcc dot gnu.org
2024-01-03 17:47 ` jakub at gcc dot gnu.org
2024-01-05 10:18 ` cvs-commit at gcc dot gnu.org
2024-01-05 10:19 ` jakub at gcc dot gnu.org
2024-01-05 14:20 ` 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).