<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79500>79500</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Clang generates redundnat stores when filling a partially initialized array.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
serge-sans-paille
</td>
</tr>
</table>
<pre>
When initializing a local array, as in
```c
int a[10] = { 1, 2, 3};
```
the trailing elements must be initialized to zero. clang achieves this goal by first setting the whole array to zero, then adding the individual stores, see https://godbolt.org/z/5x5xP3bsM
We could generate a minimal ``memset`` instead.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcUs1uozAQfhpzGQXZBpJw4NA04rbS3no2eAJeGTvyDG3Tp18ZWnW3EjJYmvn4_gyRmwJiJ5qLaK6FWXmOqSNMEx7IBDrcjfMeiyHaR_cyYwAXHDvj3YcLExjwcTQeTErmIfQzGAIXQMirkE-f51Huz7jfXWAworkoKZoriOoK4nQBlZd1Pipxuorq8mN5v_KMwMk4n_-NHhcMTLCsxDDgNzO0wBE-MMUSRm8yz3F2-IoEPDuCKRoPwwNuLhEDIXPGy-Bvc_S4q_mCyJw4CzfWfo25YN2rs6vxQBwTUh4iRJiZ7ySqJ6F7ofsp2iF6LmOahO4_hO6b9-b9dzXQr38dekEY4-otTBgwGUYwsLjgFuNhV7_gQsj7N7hAjMaWhe0q21atKbBTJ3nU6qSO52LuGqnGUeu6as5HO7TjUaqxkvakdKVa3bSF67TUtVS60Urp-lze6kHd9A2NOrfyVteilrgY50vvX5dMv3BEK3antpGy8GZAT1tltN78FVrn9qQuzx-GdSJRS--I6RuBHfutZ_tGc4XnLZov0QQJ7RpsMPxpKrxl22_O-71qd5Nyvv7xX9JbWGWxJt_9cN_xvA7lGBeh-0zj83W4p_gHRxa631SR0P0m7G8AAAD__4Wc-S8">