* [Bug target/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
@ 2022-01-24 20:59 ` qinzhao at gcc dot gnu.org
2022-01-26 18:15 ` qinzhao at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2022-01-24 20:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
qinzhao at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Last reconfirmed| |2022-01-24
--- Comment #1 from qinzhao at gcc dot gnu.org ---
I can repeat this bug with the latest upstream gcc:
[opc@qinzhao-ol8u3-x86 100775]$ sh t
/home/opc/Install/cross/bin/armv7a-hardfloat-linux-gnueabi-gcc -mthumb
-fzero-call-used-regs=used t.c -S
exit_block_uses = 0 [r0] 3 [r3] 7 [r7] 13 [sp] 14 [lr] 102 [sfp]
df->exit_block_uses = 0 [r0] 7 [r7] 13 [sp] 14 [lr] 102 [sfp]
during RTL pass: mach
t.c: In function 'foo':
t.c:5:1: internal compiler error: in df_exit_block_bitmap_verify, at
df-scan.cc:4178
5 | }
| ^
0xc6a0bf df_exit_block_bitmap_verify
../../latest-gcc/gcc/df-scan.cc:4178
0xc6a355 df_scan_verify()
../../latest-gcc/gcc/df-scan.cc:4231
0xc501a8 df_verify()
../../latest-gcc/gcc/df-core.cc:1818
0xc4eaa4 df_analyze_1
../../latest-gcc/gcc/df-core.cc:1214
0xc4ee68 df_analyze()
../../latest-gcc/gcc/df-core.cc:1290
0x194675a thumb2_reorg
../../latest-gcc/gcc/config/arm/arm.cc:18999
0x1947d60 arm_reorg
../../latest-gcc/gcc/config/arm/arm.cc:19218
0x1300436 execute
../../latest-gcc/gcc/reorg.cc:3927
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
2022-01-24 20:59 ` [Bug target/100775] " qinzhao at gcc dot gnu.org
@ 2022-01-26 18:15 ` qinzhao at gcc dot gnu.org
2022-01-26 18:16 ` qinzhao at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2022-01-26 18:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
--- Comment #2 from qinzhao at gcc dot gnu.org ---
This is a bug in pass_zero_call_used_regs, when updating df after the zeroing
sequence is added in the epilogue of the function, we should call
"df_update_exit_block_uses" to update the reg use info in the exit block to
include all the regs that have been zeroed.
I think that this is a very general issue, should be fixed into both gcc12 and
gcc11.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
2022-01-24 20:59 ` [Bug target/100775] " qinzhao at gcc dot gnu.org
2022-01-26 18:15 ` qinzhao at gcc dot gnu.org
@ 2022-01-26 18:16 ` qinzhao at gcc dot gnu.org
2022-02-10 16:40 ` [Bug middle-end/100775] " cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2022-01-26 18:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
--- Comment #3 from qinzhao at gcc dot gnu.org ---
the following simple patch resolved the issue:
diff --git a/gcc/function.cc b/gcc/function.cc
index e1d2565f8d9..c8a77c9a624 100644
--- a/gcc/function.cc
+++ b/gcc/function.cc
@@ -5942,6 +5942,7 @@ gen_call_used_regs_seq (rtx_insn *ret, unsigned int
zero_regs_type)
/* Update the data flow information. */
crtl->must_be_zero_on_return |= zeroed_hardregs;
df_set_bb_dirty (EXIT_BLOCK_PTR_FOR_FN (cfun));
+ df_update_exit_block_uses ();
}
}
will test it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
` (2 preceding siblings ...)
2022-01-26 18:16 ` qinzhao at gcc dot gnu.org
@ 2022-02-10 16:40 ` cvs-commit at gcc dot gnu.org
2022-02-10 16:41 ` qinzhao at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-10 16:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Qing Zhao <qinzhao@gcc.gnu.org>:
https://gcc.gnu.org/g:b32305b41dcafc5fb6974c0da3ce2f62251afdbf
commit r12-7183-gb32305b41dcafc5fb6974c0da3ce2f62251afdbf
Author: Qing Zhao <qing.zhao@oracle.com>
Date: Thu Feb 10 16:40:39 2022 +0000
middle-end: updating the reg use in exit block for -fzero-call-used-regs
[PR100775]
In the pass_zero_call_used_regs, when updating dataflow info after adding
the register zeroing sequence in the epilogue of the function, we should
call "df_update_exit_block_uses" to update the register use information in
the exit block to include all the registers that have been zeroed.
2022-02-10 Qing Zhao <qing.zhao@oracle.com>
gcc/ChangeLog:
PR middle-end/100775
* function.cc (gen_call_used_regs_seq): Call
df_update_exit_block_uses when updating df.
gcc/testsuite/ChangeLog:
PR middle-end/100775
* gcc.target/arm/pr100775.c: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
` (3 preceding siblings ...)
2022-02-10 16:40 ` [Bug middle-end/100775] " cvs-commit at gcc dot gnu.org
@ 2022-02-10 16:41 ` qinzhao at gcc dot gnu.org
2022-02-10 21:44 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2022-02-10 16:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
--- Comment #5 from qinzhao at gcc dot gnu.org ---
fixed in gcc12.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
` (4 preceding siblings ...)
2022-02-10 16:41 ` qinzhao at gcc dot gnu.org
@ 2022-02-10 21:44 ` pinskia at gcc dot gnu.org
2022-03-16 20:21 ` cvs-commit at gcc dot gnu.org
2022-03-16 20:22 ` qinzhao at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-10 21:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Target Milestone|--- |12.0
Resolution|--- |FIXED
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
` (5 preceding siblings ...)
2022-02-10 21:44 ` pinskia at gcc dot gnu.org
@ 2022-03-16 20:21 ` cvs-commit at gcc dot gnu.org
2022-03-16 20:22 ` qinzhao at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-16 20:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Qing Zhao <qinzhao@gcc.gnu.org>:
https://gcc.gnu.org/g:9b1faeb5bfef258780e313aa8302a43f98f3b442
commit r11-9663-g9b1faeb5bfef258780e313aa8302a43f98f3b442
Author: Qing Zhao <qing.zhao@oracle.com>
Date: Wed Mar 16 20:18:54 2022 +0000
middle-end/100775 - updating the reg use in exit block for
-fzero-call-used-regs
GCC11 backport.
In the pass_zero_call_used_regs, when updating dataflow info after adding
the register zeroing sequence in the epilogue of the function, we should
call "df_update_exit_block_uses" to update the register use information in
the exit block to include all the registers that have been zeroed.
gcc/ChangeLog:
PR middle-end/100775
* function.c (gen_call_used_regs_seq): Call
df_update_exit_block_uses when updating df.
gcc/testsuite/ChangeLog:
PR middle-end/100775
* gcc.target/arm/pr100775.c: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/100775] ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
2021-05-26 15:51 [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used zsojka at seznam dot cz
` (6 preceding siblings ...)
2022-03-16 20:21 ` cvs-commit at gcc dot gnu.org
@ 2022-03-16 20:22 ` qinzhao at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2022-03-16 20:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100775
--- Comment #8 from qinzhao at gcc dot gnu.org ---
fixed in gcc11 too.
^ permalink raw reply [flat|nested] 9+ messages in thread