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

Filip Sajdak <filip.sajdak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |16.2.0, 17.0

--- Comment #1 from Filip Sajdak <filip.sajdak at gmail dot com> ---
GCC 16.2.0 has the same lines in its header (include/c++/16/coroutine, lines
303 to 306), and the mismatched call is visible there without any out-of-tree
code.

With the program from the description, on GCC 16.2.0 (Homebrew build,
aarch64-apple-darwin25):

$ g++-16 -std=c++20 -O2 -fdump-tree-optimized -c nc.cpp

int main ()
{
  void (*<T11f>) (void *) _2;
  void (*<T11f>) (void *) _3;

  <bb 2> [local count: 1073741824]:
  _2 = MEM[(void (*<T11f>) (void *) *)&_S_fr];
  _2 (&_S_fr);
  _3 = MEM[(void (*<T11f>) (void *) *)&_S_fr + 8B];
  _3 (&_S_fr);
  return 0;
}

_S_fr.__r and _S_fr.__d are declared void (*)() and hold
__dummy_resume_destroy, a function of type void (). The dump reads them as void
(*)(void *) and calls them with one argument. On this target the program still
runs and exits with 0, since the callee ignores the register; I only state that
the call through the other type is present in 16.2.0, not that it fails there.

So this is not specific to trunk or to the WebAssembly back end that made it
visible. I have set Known to fail accordingly.

Reply via email to