Issue 76442
Summary [PowerPC] fatal error: error in backend: Cannot select: 0x8e697e8320: f128,f128 = fsincos 0x8e697eb450
Labels new issue
Assignees
Reporter pkubaj
    Clang 17.0.6 on Linux (Gentoo ppc64le) and FreeBSD 15.0 (powerpc64le)

Test case:
```
# 1 "" 3
cpowl() { int theta = cosl(theta) * sinl(theta); }
```

Compile with:
`/usr/lib/llvm/17/bin/clang-17 -cc1 -emit-obj -target-cpu ppc64le -mabi=ieeelongdouble -Werror -Weverything -Wno-gnu-line-marker -fgnuc-version=4.2.1 s_cpowl-062d88.c`

Output:
```
fatal error: error in backend: Cannot select: 0x6d420285c0: f128,f128 = fsincos 0x6d4202b6f0
  0x6d4202b6f0: f128,ch,glue = CopyFromReg 0x6d4202b680, Register:f128 $v2, 0x6d4202b680:1
    0x6d42028b70: f128 = Register $v2
    0x6d4202b680: ch,glue = callseq_end 0x6d4202b610, TargetConstant:i64<32>, TargetConstant:i64<0>, 0x6d4202b610:1
 0x6d420288d0: i64 = TargetConstant<32>
      0x6d42028940: i64 = TargetConstant<0>
      0x6d4202b610: ch,glue = PPCISD::CALL_NOP 0x6d4202b530, TargetExternalSymbol:i64'__floatsikf', Register:i64 $x3, Register:i64 $x2, RegisterMask:Untyped, 0x6d4202b530:1
 0x6d4202b5a0: i64 = TargetExternalSymbol'__floatsikf'
 0x6d42028e80: i64 = Register $x3
        0x6d42028cc0: i64 = Register $x2
        0x6d42028d30: Untyped = RegisterMask
        0x6d4202b530: ch,glue = CopyToReg 0x6d420284e0, Register:i64 $x3, 0x6d42028320
 0x6d42028e80: i64 = Register $x3
          0x6d42028320: i64,ch = load<(dereferenceable load (s32) from %ir.theta), sext from i32> 0x6d41fd2050, FrameIndex:i64<1>, undef:i64
            0x6d420282b0: i64 = FrameIndex<1>
            0x6d42028390: i64 = undef
In function: cpowl
```

This issue has been confirmed to happen on Linux, but its origin is WIP patch to switch FreeBSD/powerpc64le to IEEE long double. The issue happens when building msun library (FreeBSD's libm).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to