[llvm-branch-commits] [clang] [clang] Use tighter lifetime bounds for C temporary arguments (PR #170518)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 13 11:50:08 PST 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 51842 tests passed
* 902 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.CodeGen/lifetime-bug-2.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -O2 -emit-llvm -disable-llvm-passes C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -O2 -emit-llvm -disable-llvm-passes 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c' -o -
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c:52:58: warning: passing arguments to 'bch2_btree_iter_peek_max' without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
# |    52 |     bch2_trans_update_extent_k = bch2_btree_iter_peek_max((0, __trans_tmp_85));
# |       |                                                          ^
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c:57:1: warning: label at end of compound statement is a C23 extension [-Wc23-extensions]
# |    57 | }
# |       | ^
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c:52:60: warning: left operand of comma operator has no effect [-Wunused-value]
# |    52 |     bch2_trans_update_extent_k = bch2_btree_iter_peek_max((0, __trans_tmp_85));
# |       |                                                            ^
# | 3 warnings generated.
# `-----------------------------
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c:16:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: [[UNDEF_AGG_TMP:%.*]] = alloca [[STRUCT_BKEY_S_C]], align 1
# |                ^
# | <stdin>:18:41: note: scanning from here
# |  %agg.tmp = alloca %struct.anon, align 1
# |                                         ^
# | <stdin>:18:41: note: with "STRUCT_BKEY_S_C" equal to "%struct.bkey_s_c"
# |  %agg.tmp = alloca %struct.anon, align 1
# |                                         ^
# | <stdin>:19:17: note: possible intended match here
# |  %cleanup.dest.slot = alloca i32, align 4
# |                 ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\CodeGen\lifetime-bug-2.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           13: ; Function Attrs: nounwind 
# |           14: define dso_local void @bch2_trans_update_extent() #0 { 
# |           15: entry: 
# |           16:  %done = alloca i8, align 1 
# |           17:  %tmp = alloca %struct.bkey_s_c, align 1 
# |           18:  %agg.tmp = alloca %struct.anon, align 1 
# | next:16'0                                             X error: no match found
# | next:16'1                                               with "STRUCT_BKEY_S_C" equal to "%struct.bkey_s_c"
# |           19:  %cleanup.dest.slot = alloca i32, align 4 
# | next:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:16'2                     ?                          possible intended match
# |           20:  call void @llvm.lifetime.start.p0(ptr %done) #4 
# | next:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           21:  call void @llvm.lifetime.start.p0(ptr %tmp) #4 
# | next:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           22:  call void @llvm.lifetime.start.p0(ptr %agg.tmp) #4 
# | next:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           23:  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %agg.tmp, ptr align 1 @__trans_tmp_85, i64 4, i1 false), !tbaa.struct !10 
# | next:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           24:  %coerce.dive = getelementptr inbounds nuw %struct.anon, ptr %agg.tmp, i32 0, i32 0 
# | next:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/170518


More information about the llvm-branch-commits mailing list