<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/86427>86427</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang][IPO] Binary inconsistency occurs when compiling for multiple times in ASLR self-enabled Clang.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dongjianqiang2
</td>
</tr>
</table>
<pre>
Hi Can clang enable -fPIE by itself? I found that when compiling with -fPIE enabled Clang and the EnableHotColdSplit optimization is enabled, Clang compiles the source file multiple times, and the binary is inconsistent.
After debugging by BB printing, the function trace is extractColdRegion->extractCodeRegion->severSplitPHINodesOfExits
[severSplitPHINodesOfExits](https://github.com/llvm/llvm-project/blob/4acd84e7ccce6a2865f60cd2adc37a335d4f35ce/llvm/lib/Transforms/Utils/CodeExtractor.cpp#L749)
the ExitBB in severSplitPHINodesOfExits is inconsistent, which is from parameter Exits. From function extractCodeRegion, the declaration is SmallPtrSet<BasicBlock *, 1> ExitBlocks;
[ExitBlocks insert]https://github.com/llvm/llvm-project/blob/4acd84e7ccce6a2865f60cd2adc37a335d4f35ce/llvm/lib/Transforms/Utils/CodeExtractor.cpp#L1763
Due to the ASLR self-enabled Clang., the BasicBlock address is not fixed. As a result, the Exits traversal is not fixed ?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVE1v4zYQ_TX0ZRBDJvXlgw6WbWEDLLrBpv0BFDmSuKVIlaSSuL--IB0nuyly6K0nGmO_55n3Zh73Xo0GsSFFS4rThq9hsq6R1ow_FDd_KW5GuumtvDRfFBy5AaG5GQEN7zXC3fBwf4b-Aip41ANhHdzDYFcjIUw8wPOEBoSdF6WVGeFZhekVcyWQcEx0PAEQzqn6xYaj1fJx0SqAXYKa1d88KGtA-RuQ0OMr9kqPPhF4uzqBMCiNMK86qEUjBDWjj4Db3_TKcHeJbMoIa7zyAU3YkuxEssNhCOhAYr-OY2y6v0DbwuKUCcqMkSZSDKsRqaXguMDU2Ev8mDr_jqOy5o6w81tR4nvR4xO6NN3Dl_vfrET_bTi_qOCvDZCi_fwXxYnQegph8YQdCO0I7UYVprXfCjsT2mn9dHvuFmd_oAiEdr22PaFdzoWsc6yEEFhyWpfFUGZCUi4FqzhjhcwHVgj8iUdF3O-OGz9YN3tCuz-C0vGNM52v41m3FctCKPta5XtC99c5kqEvKrQtKAOfjvTRhqgwPE9KTPGbwdkZFu74jNGWhNgCdLH85sG_VL65JFFo7t5253HmWj8E94iBsGPLvRKttuJPIPQQITvCzteWY9UT1r458l4FZTy6QIrT_9eGXVWya-unFSHYJMbh8et3iGd698vxbW9i_aQHl9KhT9YYG2BQLyi3cPDAwaFfdbhhrg4Gx5_Qea5_AQA5d6Q9kn23kQ2Te7bnG2x21W5Hq7Ji5WZq8lrske-pqHY4ZLu6zPqq2DHJREn7nLGNamhG84zRfJexuii3Iq9ojnnOeV2XZY0kz3DmSm-jUlvrxo3yfsWmLnNabTTvUfsUbpSm5CKUxpxzTbKmX0dP8kwrH_w7Q1BBp0RM-sSTK9r7h2-kOEH7mhzv-youYIVYnf8YdoN1HyIonsFnJmxWp5v_vFBp1rgFadx_AgAA__9Fo_Hq">