Skip to content

[clang] RISC-V: failed to perform tail call elimination on a call site marked musttail #157814

@xypron

Description

@xypron

I originally experienced this error when compiling WebKit with gcc https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121784. But it is also reproducible in LLVM:

Compiling the following program with clang results in an error "failed to perform tail call elimination on a call site marked musttail".

struct StageList;
using F = __attribute__((vector_size(16))) float;
using StageFn = void (*)(StageList list, int src, int dst, F r, F g, F b);
struct StageList {
  const StageFn* fn;
};

void m(StageList list, int src, int dst,  F r, F g, F b) {
  [[clang::musttail]] 
 return (*list.fn)(list, src, dst, r, g, b);
} 

My expectation is that tail calls should be usable with any number of arguments provided that they are trivially destructible.

test-a79310.sh
test-a79310.cpp
clang.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions