public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used
@ 2021-05-26 15:51 zsojka at seznam dot cz
  2022-01-24 20:59 ` [Bug target/100775] " qinzhao at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2021-05-26 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100775
           Summary: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164
                    with -mthumb -fzero-call-used-regs=used
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: armv7a-hardfloat-linux-gnueabi

Created attachment 50873
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50873&action=edit
reduced testcase

Compiler output:
$ armv7a-hardfloat-linux-gnueabi-gcc -mthumb -fzero-call-used-regs=used
testcase.c 
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
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in df_exit_block_bitmap_verify, at
df-scan.c:4164
    5 | }
      | ^
0xbb6462 df_exit_block_bitmap_verify
        /repo/gcc-trunk/gcc/df-scan.c:4164
0xbb6462 df_scan_verify()
        /repo/gcc-trunk/gcc/df-scan.c:4217
0xba0067 df_verify()
        /repo/gcc-trunk/gcc/df-core.c:1818
0xba0067 df_analyze_1
        /repo/gcc-trunk/gcc/df-core.c:1214
0x13b5a99 thumb2_reorg
        /repo/gcc-trunk/gcc/config/arm/arm.c:18990
0x13b5a99 arm_reorg
        /repo/gcc-trunk/gcc/config/arm/arm.c:19209
0xf96979 execute
        /repo/gcc-trunk/gcc/reorg.c: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.

$ armv7a-hardfloat-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-armv7a-hardfloat/bin/armv7a-hardfloat-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-1066-20210526112842-g95d67762171-checking-yes-rtl-df-extra-armv7a-hardfloat/bin/../libexec/gcc/armv7a-hardfloat-linux-gnueabi/12.0.0/lto-wrapper
Target: armv7a-hardfloat-linux-gnueabi
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-float=hard --with-fpu=vfpv4
--with-arch=armv7-a --with-sysroot=/usr/armv7a-hardfloat-linux-gnueabi
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=armv7a-hardfloat-linux-gnueabi
--with-ld=/usr/bin/armv7a-hardfloat-linux-gnueabi-ld
--with-as=/usr/bin/armv7a-hardfloat-linux-gnueabi-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1066-20210526112842-g95d67762171-checking-yes-rtl-df-extra-armv7a-hardfloat
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210526 (experimental) (GCC)

^ 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 ` 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

end of thread, other threads:[~2022-03-16 20:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).