public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c
@ 2024-06-07 18:21 ewlu at rivosinc dot com
2024-06-07 18:25 ` [Bug tree-optimization/115387] [15 regression] " pinskia at gcc dot gnu.org
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: ewlu at rivosinc dot com @ 2024-06-07 18:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Bug ID: 115387
Summary: [15] RISC-V: ICE in iovsprintf.c
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: ---
Created attachment 58381
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58381&action=edit
freport-bug log
iovsprintf.c: In function '__vsprintf_internal':
iovsprintf.c:34:1: error: definition in block 5 follows the use
34 | __vsprintf_internal (char *string, size_t maxlen,
| ^~~~~~~~~~~~~~~~~~~
for SSA_NAME: _9 in statement:
prephitmp_36 = (char *) _9;
during GIMPLE pass: widening_mul
iovsprintf.c:34:1: internal compiler error: verify_ssa failed
0x15d36cd verify_ssa(bool, bool)
../../../gcc/gcc/tree-ssa.cc:1203
0x121d9b5 execute_function_todo
../../../gcc/gcc/passes.cc:2096
0x121de0b execute_todo
../../../gcc/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Found on all linux targets
https://github.com/patrick-rivos/gcc-postcommit-ci/issues/1067
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
@ 2024-06-07 18:25 ` pinskia at gcc dot gnu.org
2024-06-07 18:53 ` [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c ewlu at rivosinc dot com
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-07 18:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[15] RISC-V: ICE in |[15 regression] RISC-V: ICE
|iovsprintf.c |in iovsprintf.c
Target Milestone|--- |15.0
Keywords| |ice-on-valid-code
Component|target |tree-optimization
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
2024-06-07 18:25 ` [Bug tree-optimization/115387] [15 regression] " pinskia at gcc dot gnu.org
@ 2024-06-07 18:53 ` ewlu at rivosinc dot com
2024-06-08 8:39 ` pan2.li at intel dot com
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: ewlu at rivosinc dot com @ 2024-06-07 18:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Edwin Lu <ewlu at rivosinc dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ewlu at rivosinc dot com,
| |law at gcc dot gnu.org,
| |pan2.li at intel dot com,
| |patrick at rivosinc dot com
Summary|[15 regression] RISC-V: ICE |[15 regression] RISC-V: ICE
|in iovsprintf.c |in iovsprintf.c since
| |r15-1081-ge14afbe2d1c
Target| |riscv
--- Comment #1 from Edwin Lu <ewlu at rivosinc dot com> ---
Bisected to r15-1081-ge14afbe2d1c being the first bad commit
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
2024-06-07 18:25 ` [Bug tree-optimization/115387] [15 regression] " pinskia at gcc dot gnu.org
2024-06-07 18:53 ` [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c ewlu at rivosinc dot com
@ 2024-06-08 8:39 ` pan2.li at intel dot com
2024-06-09 12:16 ` dkm at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pan2.li at intel dot com @ 2024-06-08 8:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #2 from Li Pan <pan2.li at intel dot com> ---
(In reply to Edwin Lu from comment #1)
> Bisected to r15-1081-ge14afbe2d1c being the first bad commit
Ack, thanks Edwin, will try to reproduce this.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (2 preceding siblings ...)
2024-06-08 8:39 ` pan2.li at intel dot com
@ 2024-06-09 12:16 ` dkm at gcc dot gnu.org
2024-06-09 12:23 ` dkm at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: dkm at gcc dot gnu.org @ 2024-06-09 12:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Marc Poulhiès <dkm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dkm at gcc dot gnu.org
--- Comment #3 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
Created attachment 58392
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58392&action=edit
preprocessed file
Preprocessed file triggering the error
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (3 preceding siblings ...)
2024-06-09 12:16 ` dkm at gcc dot gnu.org
@ 2024-06-09 12:23 ` dkm at gcc dot gnu.org
2024-06-10 3:37 ` pan2.li at intel dot com
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: dkm at gcc dot gnu.org @ 2024-06-09 12:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #4 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
This is command line that triggers the same error in all the nightly builds for
riscv32/64 compiler explorer.
```
$ riscv32-unknown-linux-gnu-gcc -g -O2 -march=rv32gc -mabi=ilp32d input.c
-c -std=gnu11 -fgnu89-inline -g -O2 -Wall -Wwrite-strings -Wundef
-fmerge-all-constants -frounding-math -fno-stack-protector -fno-common
-Wstrict-prototypes -Wold-style-definition -fmath-errno -fPIE
-ftls-model=initial-exec -nostdinc -o iovsprintf.o
iovsprintf.c: In function '__vsprintf_internal':
iovsprintf.c:34:1: error: definition in block 5 follows the use
34 | __vsprintf_internal (char *string, size_t maxlen,
| ^~~~~~~~~~~~~~~~~~~
for SSA_NAME: _9 in statement:
prephitmp_36 = (char *) _9;
during GIMPLE pass: widening_mul
iovsprintf.c:34:1: internal compiler error: verify_ssa failed
0x162fd0f verify_ssa(bool, bool)
/mnt/barryallen/dkm/git/crosstool-ng/.build/riscv32-unknown-linux-gnu/src/gcc/gcc/tree-ssa.cc:1203
0x1292a65 execute_function_todo
/mnt/barryallen/dkm/git/crosstool-ng/.build/riscv32-unknown-linux-gnu/src/gcc/gcc/passes.cc:2096
0x1292ece execute_todo
/mnt/barryallen/dkm/git/crosstool-ng/.build/riscv32-unknown-linux-gnu/src/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.
```
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (4 preceding siblings ...)
2024-06-09 12:23 ` dkm at gcc dot gnu.org
@ 2024-06-10 3:37 ` pan2.li at intel dot com
2024-06-10 7:51 ` ubizjak at gmail dot com
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pan2.li at intel dot com @ 2024-06-10 3:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #5 from Li Pan <pan2.li at intel dot com> ---
Thanks all. I can reproduce this now.
Sorry I didn't run the test with glibc(only newlib), will take care of it ASAP.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (5 preceding siblings ...)
2024-06-10 3:37 ` pan2.li at intel dot com
@ 2024-06-10 7:51 ` ubizjak at gmail dot com
2024-06-10 11:05 ` pan2.li at intel dot com
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: ubizjak at gmail dot com @ 2024-06-10 7:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
The testcase is at [1].
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115404#c4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (6 preceding siblings ...)
2024-06-10 7:51 ` ubizjak at gmail dot com
@ 2024-06-10 11:05 ` pan2.li at intel dot com
2024-06-10 11:18 ` sjames at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pan2.li at intel dot com @ 2024-06-10 11:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #7 from Li Pan <pan2.li at intel dot com> ---
Thanks a lot. I am testing a fix, and will send it out after no surprise.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (7 preceding siblings ...)
2024-06-10 11:05 ` pan2.li at intel dot com
@ 2024-06-10 11:18 ` sjames at gcc dot gnu.org
2024-06-10 11:18 ` [Bug tree-optimization/115387] [15 regression] " sjames at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-10 11:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dcb314 at hotmail dot com
--- Comment #8 from Sam James <sjames at gcc dot gnu.org> ---
*** Bug 115414 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (8 preceding siblings ...)
2024-06-10 11:18 ` sjames at gcc dot gnu.org
@ 2024-06-10 11:18 ` sjames at gcc dot gnu.org
2024-06-10 20:14 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-10 11:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Summary|[15 regression] RISC-V: ICE |[15 regression] ICE in
|in iovsprintf.c since |iovsprintf.c since
|r15-1081-ge14afbe2d1c |r15-1081-ge14afbe2d1c
Last reconfirmed| |2024-06-10
--- Comment #9 from Sam James <sjames at gcc dot gnu.org> ---
Confirmed. Not riscv specific.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (9 preceding siblings ...)
2024-06-10 11:18 ` [Bug tree-optimization/115387] [15 regression] " sjames at gcc dot gnu.org
@ 2024-06-10 20:14 ` cvs-commit at gcc dot gnu.org
2024-06-10 21:51 ` slyfox at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-10 20:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:
https://gcc.gnu.org/g:d03ff3fd3e2da1352a404e3c53fe61314569345c
commit r15-1167-gd03ff3fd3e2da1352a404e3c53fe61314569345c
Author: Pan Li <pan2.li@intel.com>
Date: Mon Jun 10 14:13:38 2024 -0600
[PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for PHI match
When enabled the PHI handing for COND_EXPR, we need to insert the gcall
to replace the PHI node. Unfortunately, I made a mistake that insert
the gcall to before the last stmt of the bb. See below gimple, the PHI
is located at no.1 but we insert the gcall (aka no.9) to the end of
the bb. Then the use of _9 in no.2 will have no def and will trigger
ICE when verify_ssa.
1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be
deleted.
2. prephitmp_36 = (char *) _9;
3. buf.write_base = string_13(D);
4. buf.write_ptr = string_13(D);
5. buf.write_end = prephitmp_36;
6. buf.written = 0;
7. buf.mode = 3;
8. _7 = buf.write_end;
9. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to last bb
by mistake
This patch would like to insert the gcall to before the start of the bb
stmt. To ensure the possible use of PHI_result will have a def exists.
After this patch the above gimple will be:
0. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to start
bb by mistake
1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be
deleted.
2. prephitmp_36 = (char *) _9;
3. buf.write_base = string_13(D);
4. buf.write_ptr = string_13(D);
5. buf.write_end = prephitmp_36;
6. buf.written = 0;
7. buf.mode = 3;
8. _7 = buf.write_end;
The below test suites are passed for this patch:
* The rv64gcv fully regression test with newlib.
* The rv64gcv build with glibc.
* The x86 regression test with newlib.
* The x86 bootstrap test with newlib.
PR target/115387
gcc/ChangeLog:
* tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children):
Take
the gsi of start_bb instead of last_bb.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/pr115387-1.c: New test.
* gcc.target/riscv/pr115387-2.c: New test.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (10 preceding siblings ...)
2024-06-10 20:14 ` cvs-commit at gcc dot gnu.org
@ 2024-06-10 21:51 ` slyfox at gcc dot gnu.org
2024-06-11 6:59 ` dkm at gcc dot gnu.org
2024-06-16 21:33 ` law at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: slyfox at gcc dot gnu.org @ 2024-06-10 21:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Sergei Trofimovich <slyfox at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |slyfox at gcc dot gnu.org
--- Comment #11 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
*** Bug 115404 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (11 preceding siblings ...)
2024-06-10 21:51 ` slyfox at gcc dot gnu.org
@ 2024-06-11 6:59 ` dkm at gcc dot gnu.org
2024-06-16 21:33 ` law at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: dkm at gcc dot gnu.org @ 2024-06-11 6:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
--- Comment #12 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
I can confirm both our riscv32/64 builds are back to normal, thanks!
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/115387] [15 regression] ICE in iovsprintf.c since r15-1081-ge14afbe2d1c
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
` (12 preceding siblings ...)
2024-06-11 6:59 ` dkm at gcc dot gnu.org
@ 2024-06-16 21:33 ` law at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: law at gcc dot gnu.org @ 2024-06-16 21:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115387
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #13 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Fixed on the trunk.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-06-16 21:33 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-07 18:21 [Bug target/115387] New: [15] RISC-V: ICE in iovsprintf.c ewlu at rivosinc dot com
2024-06-07 18:25 ` [Bug tree-optimization/115387] [15 regression] " pinskia at gcc dot gnu.org
2024-06-07 18:53 ` [Bug tree-optimization/115387] [15 regression] RISC-V: ICE in iovsprintf.c since r15-1081-ge14afbe2d1c ewlu at rivosinc dot com
2024-06-08 8:39 ` pan2.li at intel dot com
2024-06-09 12:16 ` dkm at gcc dot gnu.org
2024-06-09 12:23 ` dkm at gcc dot gnu.org
2024-06-10 3:37 ` pan2.li at intel dot com
2024-06-10 7:51 ` ubizjak at gmail dot com
2024-06-10 11:05 ` pan2.li at intel dot com
2024-06-10 11:18 ` sjames at gcc dot gnu.org
2024-06-10 11:18 ` [Bug tree-optimization/115387] [15 regression] " sjames at gcc dot gnu.org
2024-06-10 20:14 ` cvs-commit at gcc dot gnu.org
2024-06-10 21:51 ` slyfox at gcc dot gnu.org
2024-06-11 6:59 ` dkm at gcc dot gnu.org
2024-06-16 21:33 ` law 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).