forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
Description
Checklist
- Checked the issue tracker for similar issues to ensure this is not a duplicate
- Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
- Tested with the latest version to ensure the issue hasn't been fixed
How often does this bug occurs?
always
Expected behavior
correct compile
Actual behavior (suspected bug)
compile follow ir to .o file , got the <unknown>:0: error: Undefined temporary symbol .L error
/Users/zhangzhiyang/Library/Caches/llgo/crosscompile/esp-clang-19.1.2_20250905-3/bin/clang++ --target=xtensa -mcpu=esp32 -Wno-override-module -Qunused-arguments -Wno-unused-command-line-argument --target=xtensa -Werror -fshort-enums -Wno-macro-redefined -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -I/Users/zhangzhiyang/Library/Caches/llgo/crosscompile/newlib-esp32-esp-4.3.0_20250211-patch3/newlib/libc/include -I/Users/zhangzhiyang/Library/Caches/llgo/crosscompile/newlib-esp32-esp-4.3.0_20250211-patch3/newlib -I/Users/zhangzhiyang/Library/Caches/llgo/crosscompile/newlib-esp32-esp-4.3.0_20250211-patch3/newlib/libc -o ./test.o -c ./test.ll
<unknown>:0: error: Undefined temporary symbol .L
error: cannot compile inline asm
1 error generated.; ModuleID = 'github.com/goplus/lib/demo/checkoverflow'
source_filename = "github.com/goplus/lib/demo/checkoverflow"
%"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr }
%"github.com/goplus/llgo/runtime/internal/runtime.String" = type { ptr, i32 }
%"github.com/goplus/llgo/runtime/internal/runtime.Slice" = type { ptr, i32, i32 }
@"github.com/goplus/lib/demo/checkoverflow.init$guard" = global i1 false, align 1
@_llgo_uint8 = linkonce global ptr null, align 4
@"[]_llgo_uint8" = linkonce global ptr null, align 4
@_llgo_int8 = linkonce global ptr null, align 4
@"[1024]_llgo_int8" = linkonce global ptr null, align 4
@"[512]_llgo_int8" = linkonce global ptr null, align 4
@"[256]_llgo_int8" = linkonce global ptr null, align 4
@"[256]_llgo_uint8" = linkonce global ptr null, align 4
@0 = private unnamed_addr constant [12 x i8] c"invalid type", align 1
@_llgo_string = linkonce global ptr null, align 4
define void @"github.com/goplus/lib/demo/checkoverflow.init"() {
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/lib/demo/checkoverflow.init$guard", align 1
br i1 %0, label %_llgo_2, label %_llgo_1
_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"github.com/goplus/lib/demo/checkoverflow.init$guard", align 1
call void @"github.com/goplus/lib/demo/checkoverflow.init$after"()
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}
define void @"github.com/goplus/lib/demo/checkoverflow.main"() {
_llgo_0:
ret void
}
define void @"github.com/goplus/lib/demo/checkoverflow.init$after"() {
_llgo_0:
%0 = load ptr, ptr @_llgo_uint8, align 8
%1 = icmp eq ptr %0, null
br i1 %1, label %_llgo_1, label %_llgo_2
_llgo_1: ; preds = %_llgo_0
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 40)
store ptr %2, ptr @_llgo_uint8, align 8
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
%3 = load ptr, ptr @"[]_llgo_uint8", align 8
%4 = icmp eq ptr %3, null
br i1 %4, label %_llgo_3, label %_llgo_4
_llgo_3: ; preds = %_llgo_2
%5 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 40)
%6 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr %5)
store ptr %6, ptr @"[]_llgo_uint8", align 8
br label %_llgo_4
_llgo_4: ; preds = %_llgo_3, %_llgo_2
%7 = load ptr, ptr @_llgo_int8, align 8
%8 = icmp eq ptr %7, null
br i1 %8, label %_llgo_5, label %_llgo_6
_llgo_5: ; preds = %_llgo_4
%9 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 35)
store ptr %9, ptr @_llgo_int8, align 8
br label %_llgo_6
_llgo_6: ; preds = %_llgo_5, %_llgo_4
%10 = load ptr, ptr @"[1024]_llgo_int8", align 8
%11 = icmp eq ptr %10, null
br i1 %11, label %_llgo_7, label %_llgo_8
_llgo_7: ; preds = %_llgo_6
%12 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 35)
%13 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i32 1024, ptr %12)
store ptr %13, ptr @"[1024]_llgo_int8", align 8
br label %_llgo_8
_llgo_8: ; preds = %_llgo_7, %_llgo_6
%14 = load ptr, ptr @"[512]_llgo_int8", align 8
%15 = icmp eq ptr %14, null
br i1 %15, label %_llgo_9, label %_llgo_10
_llgo_9: ; preds = %_llgo_8
%16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 35)
%17 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i32 512, ptr %16)
store ptr %17, ptr @"[512]_llgo_int8", align 8
br label %_llgo_10
_llgo_10: ; preds = %_llgo_9, %_llgo_8
%18 = load ptr, ptr @"[256]_llgo_int8", align 8
%19 = icmp eq ptr %18, null
br i1 %19, label %_llgo_11, label %_llgo_12
_llgo_11: ; preds = %_llgo_10
%20 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 35)
%21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i32 256, ptr %20)
store ptr %21, ptr @"[256]_llgo_int8", align 8
br label %_llgo_12
_llgo_12: ; preds = %_llgo_11, %_llgo_10
%22 = load ptr, ptr @"[256]_llgo_uint8", align 8
%23 = icmp eq ptr %22, null
br i1 %23, label %_llgo_13, label %_llgo_14
_llgo_13: ; preds = %_llgo_12
%24 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 40)
%25 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i32 256, ptr %24)
store ptr %25, ptr @"[256]_llgo_uint8", align 8
br label %_llgo_14
_llgo_14: ; preds = %_llgo_13, %_llgo_12
%26 = load ptr, ptr @_llgo_string, align 8
%27 = icmp eq ptr %26, null
br i1 %27, label %_llgo_15, label %_llgo_16
_llgo_15: ; preds = %_llgo_14
%28 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32 24)
store ptr %28, ptr @_llgo_string, align 8
br label %_llgo_16
_llgo_16: ; preds = %_llgo_15, %_llgo_14
ret void
}
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.Basic"(i32)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.SliceOf"(ptr)
declare void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.ArrayOf"(i32, ptr)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i32)
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i32)
define ptr @"github.com/goplus/lib/demo/checkoverflow.direntNamePtr"([2 x i32] %0) {
_llgo_0:
%1 = alloca [2 x i32], align 4
store [2 x i32] %0, ptr %1, align 4
%2 = load %"github.com/goplus/llgo/runtime/internal/runtime.eface", ptr %1, align 8
%3 = alloca %"github.com/goplus/llgo/runtime/internal/runtime.eface", align 8
%4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 0
%5 = load ptr, ptr @_llgo_uint8, align 8
%6 = load ptr, ptr @"[]_llgo_uint8", align 8
%7 = icmp eq ptr %4, %6
br i1 %7, label %_llgo_11, label %_llgo_12
_llgo_1: ; preds = %_llgo_13
%8 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, 0
%9 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %44, 1
%10 = icmp sge i32 0, %9
call void @"github.com/goplus/llgo/runtime/internal/runtime.AssertIndexRange"(i1 %10)
%11 = getelementptr inbounds i8, ptr %8, i32 0
ret ptr %11
_llgo_2: ; preds = %_llgo_13
%12 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 0
%13 = load ptr, ptr @_llgo_int8, align 8
%14 = load ptr, ptr @"[1024]_llgo_int8", align 8
%15 = icmp eq ptr %12, %14
br i1 %15, label %_llgo_14, label %_llgo_15
_llgo_3: ; preds = %_llgo_16
%16 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i32 1024)
store [1024 x i8] %51, ptr %16, align 1
%17 = getelementptr inbounds i8, ptr %16, i32 0
ret ptr %17
_llgo_4: ; preds = %_llgo_16
%18 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 0
%19 = load ptr, ptr @"[512]_llgo_int8", align 8
%20 = icmp eq ptr %18, %19
br i1 %20, label %_llgo_17, label %_llgo_18
_llgo_5: ; preds = %_llgo_19
%21 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i32 512)
store [512 x i8] %58, ptr %21, align 1
%22 = getelementptr inbounds i8, ptr %21, i32 0
ret ptr %22
_llgo_6: ; preds = %_llgo_19
%23 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 0
%24 = load ptr, ptr @"[256]_llgo_int8", align 8
%25 = icmp eq ptr %23, %24
br i1 %25, label %_llgo_20, label %_llgo_21
_llgo_7: ; preds = %_llgo_22
%26 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i32 256)
store [256 x i8] %65, ptr %26, align 1
%27 = getelementptr inbounds i8, ptr %26, i32 0
ret ptr %27
_llgo_8: ; preds = %_llgo_22
%28 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 0
%29 = load ptr, ptr @_llgo_uint8, align 8
%30 = load ptr, ptr @"[256]_llgo_uint8", align 8
%31 = icmp eq ptr %28, %30
br i1 %31, label %_llgo_23, label %_llgo_24
_llgo_9: ; preds = %_llgo_25
%32 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i32 256)
store [256 x i8] %72, ptr %32, align 1
%33 = getelementptr inbounds i8, ptr %32, i32 0
ret ptr %33
_llgo_10: ; preds = %_llgo_25
%34 = load ptr, ptr @_llgo_string, align 8
%35 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i32 8)
store %"github.com/goplus/llgo/runtime/internal/runtime.String" { ptr @0, i32 12 }, ptr %35, align 8
%36 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %34, 0
%37 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %36, ptr %35, 1
store %"github.com/goplus/llgo/runtime/internal/runtime.eface" %37, ptr %3, align 8
%38 = load [2 x i32], ptr %3, align 4
call void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"([2 x i32] %38)
unreachable
_llgo_11: ; preds = %_llgo_0
%39 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 1
%40 = load %"github.com/goplus/llgo/runtime/internal/runtime.Slice", ptr %39, align 8
%41 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } undef, %"github.com/goplus/llgo/runtime/internal/runtime.Slice" %40, 0
%42 = insertvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %41, i1 true, 1
br label %_llgo_13
_llgo_12: ; preds = %_llgo_0
br label %_llgo_13
_llgo_13: ; preds = %_llgo_12, %_llgo_11
%43 = phi { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } [ %42, %_llgo_11 ], [ zeroinitializer, %_llgo_12 ]
%44 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %43, 0
%45 = extractvalue { %"github.com/goplus/llgo/runtime/internal/runtime.Slice", i1 } %43, 1
br i1 %45, label %_llgo_1, label %_llgo_2
_llgo_14: ; preds = %_llgo_2
%46 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 1
%47 = load [1024 x i8], ptr %46, align 1
%48 = insertvalue { [1024 x i8], i1 } undef, [1024 x i8] %47, 0
%49 = insertvalue { [1024 x i8], i1 } %48, i1 true, 1
br label %_llgo_16
_llgo_15: ; preds = %_llgo_2
br label %_llgo_16
_llgo_16: ; preds = %_llgo_15, %_llgo_14
%50 = phi { [1024 x i8], i1 } [ %49, %_llgo_14 ], [ zeroinitializer, %_llgo_15 ]
%51 = extractvalue { [1024 x i8], i1 } %50, 0
%52 = extractvalue { [1024 x i8], i1 } %50, 1
br i1 %52, label %_llgo_3, label %_llgo_4
_llgo_17: ; preds = %_llgo_4
%53 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 1
%54 = load [512 x i8], ptr %53, align 1
%55 = insertvalue { [512 x i8], i1 } undef, [512 x i8] %54, 0
%56 = insertvalue { [512 x i8], i1 } %55, i1 true, 1
br label %_llgo_19
_llgo_18: ; preds = %_llgo_4
br label %_llgo_19
_llgo_19: ; preds = %_llgo_18, %_llgo_17
%57 = phi { [512 x i8], i1 } [ %56, %_llgo_17 ], [ zeroinitializer, %_llgo_18 ]
%58 = extractvalue { [512 x i8], i1 } %57, 0
%59 = extractvalue { [512 x i8], i1 } %57, 1
br i1 %59, label %_llgo_5, label %_llgo_6
_llgo_20: ; preds = %_llgo_6
%60 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 1
%61 = load [256 x i8], ptr %60, align 1
%62 = insertvalue { [256 x i8], i1 } undef, [256 x i8] %61, 0
%63 = insertvalue { [256 x i8], i1 } %62, i1 true, 1
br label %_llgo_22
_llgo_21: ; preds = %_llgo_6
br label %_llgo_22
_llgo_22: ; preds = %_llgo_21, %_llgo_20
%64 = phi { [256 x i8], i1 } [ %63, %_llgo_20 ], [ zeroinitializer, %_llgo_21 ]
%65 = extractvalue { [256 x i8], i1 } %64, 0
%66 = extractvalue { [256 x i8], i1 } %64, 1
br i1 %66, label %_llgo_7, label %_llgo_8
_llgo_23: ; preds = %_llgo_8
%67 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %2, 1
%68 = load [256 x i8], ptr %67, align 1
%69 = insertvalue { [256 x i8], i1 } undef, [256 x i8] %68, 0
%70 = insertvalue { [256 x i8], i1 } %69, i1 true, 1
br label %_llgo_25
_llgo_24: ; preds = %_llgo_8
br label %_llgo_25
_llgo_25: ; preds = %_llgo_24, %_llgo_23
%71 = phi { [256 x i8], i1 } [ %70, %_llgo_23 ], [ zeroinitializer, %_llgo_24 ]
%72 = extractvalue { [256 x i8], i1 } %71, 0
%73 = extractvalue { [256 x i8], i1 } %71, 1
br i1 %73, label %_llgo_9, label %_llgo_10
}
declare void @"github.com/goplus/llgo/runtime/internal/runtime.Panic"([2 x i32])
Error logs or terminal output
Steps to reproduce the behavior
- wget https://github.com/espressif/llvm-project/releases/download/esp-19.1.2_20250312/clang-esp-19.1.2_20250312-aarch64-apple-darwin.tar.xz
- tar -xzf ./clang-esp-19.1.2_20250312-aarch64-apple-darwin.tar.xz -C clang-test
lib/test on emb/esp [!?] took 3s
❯ ./clang-test/esp-clang/bin/clang-19 -v
Espressif clang version 19.1.2 (https://github.com/espressif/llvm-project.git esp-19.1.2_20250312)
Target: riscv32-esp-unknown-elf
Thread model: posix
InstalledDir: /Users/zhangzhiyang/Documents/Code/goplus/lib/test/clang-test/esp-clang/bintry to compile
./clang-test/esp-clang/bin/clang-19 --target=xtensa-esp-elf -mcpu=esp32 -Wno-override-module -Qunused-arguments -Wno-unused-command-line-argument -Werror -fshort-enums -Wno-macro-redefined -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -o test.o ./test.ll
<unknown>:0: error: Undefined temporary symbol .L
error: cannot compile inline asm
1 error generated.Project release version
System architecture
ARM 64-bit (Apple M1/M2, Raspberry Pi 4/5)
Operating system
MacOS
Operating system version
macos 15.5 (24F74)
Shell
ZSH
Additional context
No response