public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa
@ 2024-05-24 23:36 ewlu at rivosinc dot com
  2024-05-24 23:43 ` [Bug tree-optimization/115220] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ewlu at rivosinc dot com @ 2024-05-24 23:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115220
           Summary: [15] RISC-V: newlib targets ICE during sink pass
                    triggered in verify_ssa
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ewlu at rivosinc dot com
  Target Milestone: ---

Our gcc postcommit is encountering build failures for all newlib targets
https://github.com/patrick-rivos/gcc-postcommit-ci/issues/981 with the
potential commits which caused the ice shown here
https://github.com/gcc-mirror/gcc/compare/c71886f2ca2e46ce1449c7064d6f1b447d02fcba...6d6f324bda1ccb51cd43ff9d4d017eb71bb2d690

during GIMPLE pass: sink
/home/runner/work/gcc-postcommit-ci/gcc-postcommit-ci/riscv-gnu-toolchain/newlib/newlib/libc/include/stdlib.h:212:9:
internal compiler error: verify_ssa failed
0x16ce85e verify_ssa(bool, bool)
        ../../../gcc/gcc/tree-ssa.cc:1203
0x12ef125 execute_function_todo
        ../../../gcc/gcc/passes.cc:2096
0x12ef98e execute_todo
        ../../../gcc/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Potentially related:
Also getting this error in the build logs. 
/home/runner/work/gcc-postcommit-ci/gcc-postcommit-ci/riscv-gnu-toolchain/newlib/newlib/libc/include/stdlib.h:212:9:
error: stmt with wrong VUSE
  212 | int     _setenv_r (struct _reent *, const char *__string, const char
*__value, int __overwrite);
      |         ^~~~~~~~~
# .MEM_109 = VDEF <.MEM_67>
*C_59 = 61;
expected .MEM_106

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

* [Bug tree-optimization/115220] [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
@ 2024-05-24 23:43 ` pinskia at gcc dot gnu.org
  2024-05-25  0:12 ` [Bug tree-optimization/115220] [15 Regression] " ewlu at rivosinc dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-24 23:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.0
           Keywords|                            |ice-on-valid-code
          Component|target                      |tree-optimization

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you provide the preprocessed source?

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
  2024-05-24 23:43 ` [Bug tree-optimization/115220] " pinskia at gcc dot gnu.org
@ 2024-05-25  0:12 ` ewlu at rivosinc dot com
  2024-05-25  0:13 ` ewlu at rivosinc dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ewlu at rivosinc dot com @ 2024-05-25  0:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Edwin Lu <ewlu at rivosinc dot com> ---
Created attachment 58283
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58283&action=edit
-freport-bug output

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
  2024-05-24 23:43 ` [Bug tree-optimization/115220] " pinskia at gcc dot gnu.org
  2024-05-25  0:12 ` [Bug tree-optimization/115220] [15 Regression] " ewlu at rivosinc dot com
@ 2024-05-25  0:13 ` ewlu at rivosinc dot com
  2024-05-25  0:26 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ewlu at rivosinc dot com @ 2024-05-25  0:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Edwin Lu <ewlu at rivosinc dot com> ---
(In reply to Andrew Pinski from comment #1)
> Can you provide the preprocessed source?

I attached the -freport-bug output. Please lmk if you need anything else!

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
                   ` (2 preceding siblings ...)
  2024-05-25  0:13 ` ewlu at rivosinc dot com
@ 2024-05-25  0:26 ` pinskia at gcc dot gnu.org
  2024-05-25  2:03 ` law at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-25  0:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Edwin Lu from comment #3)
> (In reply to Andrew Pinski from comment #1)
> > Can you provide the preprocessed source?
> 
> I attached the -freport-bug output. Please lmk if you need anything else!

that is enough.

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
                   ` (3 preceding siblings ...)
  2024-05-25  0:26 ` pinskia at gcc dot gnu.org
@ 2024-05-25  2:03 ` law at gcc dot gnu.org
  2024-05-27  6:55 ` [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?) rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: law at gcc dot gnu.org @ 2024-05-25  2:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |law at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2024-05-25
             Target|riscv                       |riscv,fr30

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
It's a generic problem.  Almost certainly caused by the recent changes to the
sinking code.

It can be triggered (for example) on the fr30-elf port with -Os on this trivial
testcase:


extern char **environ;
static char ***p_environ = &environ;
int
_setenv_r (const char *name, const char *value)
{
  register char *C;
  int offset;
  for (C = (*p_environ)[offset]; (*C = *name++) && *C != '='; ++C);
  for (*C++ = '='; (*C++ = *value++) != 0;);


  return 0;
}

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?)
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
                   ` (4 preceding siblings ...)
  2024-05-25  2:03 ` law at gcc dot gnu.org
@ 2024-05-27  6:55 ` rguenth at gcc dot gnu.org
  2024-05-27  7:39 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-27  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.  Looks similar to the libgo issue I actually fixed...

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?)
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
                   ` (5 preceding siblings ...)
  2024-05-27  6:55 ` [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?) rguenth at gcc dot gnu.org
@ 2024-05-27  7:39 ` rguenth at gcc dot gnu.org
  2024-05-27 10:45 ` cvs-commit at gcc dot gnu.org
  2024-05-27 10:46 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-27  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so we have a case where we sink a store ignoring a killing use of the
VDEF that post-dominates the store.  The issue with that is the virtual
operand update assumes such stores are on separate paths and that
ultimatively the discovered PHI merges the defs of all those "uses".

Both constraints are violated - the PHI node is actually dominating the
original stmt as it's the loop header PHI which isn't on the path from
the "use" (the killing def after the loop).

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?)
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
                   ` (6 preceding siblings ...)
  2024-05-27  7:39 ` rguenth at gcc dot gnu.org
@ 2024-05-27 10:45 ` cvs-commit at gcc dot gnu.org
  2024-05-27 10:46 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-27 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r15-850-gf9fbb47987efc8b5261e4cc36613c928a8693493
Author: Richard Biener <rguenther@suse.de>
Date:   Mon May 27 09:40:19 2024 +0200

    tree-optimization/115220 - fix store sinking virtual operand constraints

    The following makes sure the virtual operand updating when sinking
    stores works for the case we ignore paths to kills.  The final
    sink location might not post-dominate the original stmt location
    which would require inserting of a virtual PHI which we do not support.

            PR tree-optimization/115220
            PR tree-optimization/115226
            * tree-ssa-sink.cc (statement_sink_location): When ignoring
            paths to kills when sinking stores make sure the final
            sink location is still post-dominated by the original one.
            Otherwise we'd need to insert a PHI node to merge virtual operands.

            * gcc.dg/torture/pr115220.c: New testcase.
            * gcc.dg/torture/pr115226.c: New testcase.

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

* [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?)
  2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
                   ` (7 preceding siblings ...)
  2024-05-27 10:45 ` cvs-commit at gcc dot gnu.org
@ 2024-05-27 10:46 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-27 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-05-27 10:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-24 23:36 [Bug target/115220] New: [15] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa ewlu at rivosinc dot com
2024-05-24 23:43 ` [Bug tree-optimization/115220] " pinskia at gcc dot gnu.org
2024-05-25  0:12 ` [Bug tree-optimization/115220] [15 Regression] " ewlu at rivosinc dot com
2024-05-25  0:13 ` ewlu at rivosinc dot com
2024-05-25  0:26 ` pinskia at gcc dot gnu.org
2024-05-25  2:03 ` law at gcc dot gnu.org
2024-05-27  6:55 ` [Bug tree-optimization/115220] [15 Regression] RISC-V: newlib targets ICE during sink pass triggered in verify_ssa (since r15-815-g5b9b3bae33cae7?) rguenth at gcc dot gnu.org
2024-05-27  7:39 ` rguenth at gcc dot gnu.org
2024-05-27 10:45 ` cvs-commit at gcc dot gnu.org
2024-05-27 10:46 ` rguenth 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).