<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94661>94661</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
valgrind error at CodeGenModule.cpp:2531
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:codegen,
code-quality
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
From the clang testsuite, file ./Analysis/analysis-after-multiple-dtors.cpp
does this with a valgrind version of recent clang:
test $ valgrind -q --trace-children=yes ~/llvm/results/bin/clang++ -c -w ./Analysis/analysis-after-multiple-dtors.cpp
==424675== Conditional jump or move depends on uninitialised value(s)
==424675== at 0x2429FF9: clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(clang::Decl const*, llvm::Function*) (CodeGenModule.cpp:2531)
==424675== by 0x26F5B23: clang::CodeGen::CodeGenModule::codegenCXXStructor(clang::GlobalDecl) (CGCXX.cpp:216)
The source code line in error is
if (isa<CXXMethodDecl>(D) && F->getPointerAlignment(getDataLayout()) < 2)
The bug first seems to occur sometime between git hash 1579e9ca9ce17364963861517fecf13b00fe4d8a and 83646590afe222cfdd792514854549077e17b005.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclMuO47YShp-G3hRkSKQu1kILtz3qTTdwgDkIvKXIksQBRXrIUne8ybMHlKfjHiCDINkIvKj--n5WoWSMZnKIHaueWHXeyZVmHzqtBlGUu8HrW9cHvwDNCMpKNwFhpLgaQsZPMBqLsGe8Pzppb9FExnv5Y5nJkTBky2rJXC1mmnyIe3W9svzM8qP2GIFmE-Hd0AwS3qSdgnEa3jBE4x34EQIqdHTPzMTxHnn_Jg5gvHzEZd8hyyhIhZmajdUBHRPnG0b4g_He2reF8T5gXC0lzsE4xvu7NH9i_AkAMgXZ-380xMSZiXPJy7qp7ms4eacNGe-khW_rcgUfYPFvCBqv6HQE72B1x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