Skip to content

Assertion failed: ((CGF.CurFuncDecl == nullptr || CGF.Builder.getIsFPConstrained() || isa<CXXConstructorDecl>(CGF.CurFuncDecl) || isa<CXXDestructorDecl>(CGF.CurFuncDecl) || (NewExceptionBehavior == llvm::fp::ebIgnore && NewRoundingBehavior == llvm::RoundingMode::NearestTiesToEven)) && "FPConstrained should be enabled on entire function"), function ConstructorHelper, file /usr/src/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp, line 165. #63542

Closed
@pkubaj

Description

@pkubaj

FreeBSD 14.0-CURRENT
LLVM 16.0.6
powerpc64le, powerpc64, powerpc

Reproducer:

template <class Compare> void stable_sort(int last, Compare) {
  stable_sort(last, int());
}
#pragma STDC FENV_ACCESS ON
struct cluster_result {
  int operator[](int);
};
template <int> void generate_SciPy_dendrogram() {
  cluster_result Z2;
  int trans_tmp_1(0);
  int trans_tmp_2 = Z2[1];
  stable_sort(trans_tmp_1, trans_tmp_2);
}
void linkage_wrap() { generate_SciPy_dendrogram<false>; }

Build with:

/usr/bin/c++ -cc1 -triple powerpc-unknown-freebsd14.0 -emit-obj fastcluster_python-684654.cpp

Output:

Assertion failed: ((CGF.CurFuncDecl == nullptr || CGF.Builder.getIsFPConstrained() || isa<CXXConstructorDecl>(CGF.CurFuncDecl) || isa<CXXDestructorDecl>(CGF.CurFuncDecl) || (NewExceptionBehavior == llvm::fp::ebIgnore && NewRoundingBehavior == llvm::RoundingMode::NearestTiesToEven)) && "FPConstrained should be enabled on entire function"), function ConstructorHelper, file /usr/src/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp, line 165.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]floating-pointFloating-point math

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions