public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt()
@ 2024-02-07 21:13 zsojka at seznam dot cz
  2024-02-07 21:31 ` [Bug tree-optimization/113818] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zsojka at seznam dot cz @ 2024-02-07 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113818
           Summary: ICE: verify_gimple failed: missing 'PHI' def with -Os
                    -fnon-call-exceptions -finstrument-functions-once and
                    _BitInt()
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fnon-call-exceptions -finstrument-functions-once
testcase.c 
testcase.c: In function 'foo':
testcase.c:9:1: error: missing 'PHI' def
    9 | foo (void)
      | ^~~
testcase.c:9:1: error: missing 'PHI' def
testcase.c:9:1: error: missing 'PHI' def
finally_tmp.7_7 = PHI <0(5), 2(10), 1(9), (8), (6), (7)>
during GIMPLE pass: bitintlower
testcase.c:9:1: internal compiler error: verify_gimple failed
0x155b7cd verify_gimple_in_cfg(function*, bool, bool)
        /repo/gcc-trunk/gcc/tree-cfg.cc:5666
0x13cac94 execute_function_todo
        /repo/gcc-trunk/gcc/passes.cc:2088
0x13cb1ee execute_todo
        /repo/gcc-trunk/gcc/passes.cc:2142
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8869-20240207154951-g8636c538b68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8869-20240207154951-g8636c538b68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240207 (experimental) (GCC)

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

* [Bug tree-optimization/113818] ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt()
  2024-02-07 21:13 [Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt() zsojka at seznam dot cz
@ 2024-02-07 21:31 ` pinskia at gcc dot gnu.org
  2024-02-08 16:42 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-07 21:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. I tried to get a similar IR with cleanup attribute instead of
-finstrument-functions-once but I could not due to cleanup's try/finally being
wrapped via the one for clobbers rather than on the outside.

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

* [Bug tree-optimization/113818] ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt()
  2024-02-07 21:13 [Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt() zsojka at seznam dot cz
  2024-02-07 21:31 ` [Bug tree-optimization/113818] " pinskia at gcc dot gnu.org
@ 2024-02-08 16:42 ` jakub at gcc dot gnu.org
  2024-02-09 10:08 ` cvs-commit at gcc dot gnu.org
  2024-02-09 10:14 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-08 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Untested fix.

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

* [Bug tree-optimization/113818] ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt()
  2024-02-07 21:13 [Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt() zsojka at seznam dot cz
  2024-02-07 21:31 ` [Bug tree-optimization/113818] " pinskia at gcc dot gnu.org
  2024-02-08 16:42 ` jakub at gcc dot gnu.org
@ 2024-02-09 10:08 ` cvs-commit at gcc dot gnu.org
  2024-02-09 10:14 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-09 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:6c124873f5197ca8aac5acfada4b0e7fba49807f

commit r14-8895-g6c124873f5197ca8aac5acfada4b0e7fba49807f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 9 11:07:34 2024 +0100

    lower-bitint: Fix up additions of EH edges [PR113818]

    Due to -fnon-call-exceptions the bitint lowering adds new EH edges
    in various places, so that the EH edge points from handling (e.g. load or
    store) of each of the limbs.  The problem is that the EH edge destination
    as shown in the testcase can have some PHIs.  If it is just a virtual
    PHI, no big deal, the pass uses TODO_update_ssa_only_virtuals, but if
    it has other PHIs, I think we need to copy the values from the preexisting
    corresponding EH edge (which is from the original stmt to the EH pad)
    to the newly added EH edge, so that the PHI arguments are the same rather
    than missing (which ICEs during checking at the end of the pass).

    This patch adds a function to do that and uses it whenever adding EH edges.

    2024-02-09  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113818
            * gimple-lower-bitint.cc (add_eh_edge): New function.
            (bitint_large_huge::handle_load,
            bitint_large_huge::lower_mergeable_stmt,
            bitint_large_huge::lower_muldiv_stmt): Use it.

            * gcc.dg/bitint-89.c: New test.

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

* [Bug tree-optimization/113818] ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt()
  2024-02-07 21:13 [Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt() zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-02-09 10:08 ` cvs-commit at gcc dot gnu.org
@ 2024-02-09 10:14 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-09 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2024-02-09 10:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-07 21:13 [Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt() zsojka at seznam dot cz
2024-02-07 21:31 ` [Bug tree-optimization/113818] " pinskia at gcc dot gnu.org
2024-02-08 16:42 ` jakub at gcc dot gnu.org
2024-02-09 10:08 ` cvs-commit at gcc dot gnu.org
2024-02-09 10:14 ` 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).