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

            Bug ID: 127536
           Summary: [GIMPLE FE] ICE in release_function_body for an
                    'inline' function with a __GIMPLE body
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: captainnemo9292 at gmail dot com
  Target Milestone: ---
            Target: x86_64-linux-gnu

inline void __GIMPLE (ssa) a() { }

  $ gcc -fgimple -c t.c
  cc1: internal compiler error: in release_function_body, at cgraph.cc:2206
  fancy_abort
  cgraph_node::release_body(bool)
  cgraph_node::remove()
  symbol_table::finalize_compilation_unit()
  https://godbolt.org/z/1j3jrMqd3

With C99 inline semantics the function is not emitted, so the cgraph node
is removed at the end of the unit. The GIMPLE body is already in SSA form
with a CFG at that point (the parser builds it directly), which
release_function_body does not expect for a function that never went
through analyze/expand, hence the assertion. A larger fuzzer-generated
variant with __inline and two __GIMPLE functions dies one step earlier in
analyze_functions (cgraphunit.cc:1432) for the same reason.
gcc trunk 17.0.0 20260920; the small testcase also ICEs gcc 13.

Reply via email to