<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylks1u2zAMx5_GvhA1_KXYPviQJWux-15AsmhbnSJlFpU0ffrRDoqtxQYUGEDJokj_-ZNE5fWt3zuILgbUkOzyQDqp9myB5PCDN8CrZxwIroZmoBlB4yijpXfJGn9GXJMV_4ROgwngPIFC4yZAa07GSUKdwfeZQ2zSBg-0RITRL_B0OMADBESYic5hFS0f2SavlbeU-WVi75VHU3dfn16eX4osyY9Jvr_P30a4-QjDLN2EG-UbCPl3oBc-il9WUrMeyVpGhMGfzhYJ7e0PVDAODlau-Bd0YO4VzjHMHNOSJCewuKFso9-0vGOJv6mt1ViBZ-0xuKRsiPMcSS4i3e2u97kLGIMcJIr2NUt1X-mu6mQqI81-6Uez4FVeMI2L7T_o8OtFlTEbO9Ze3j4P58Wvz8uuCSFi4IWoyl2bzr3shGjrvNgVQz4Uos5FUzWiU-MOi1ZpkVqp0IY-EV-SsnR4hU2C14k4pv9PYPoyL8u8KNpCFHndZl3T6VqMom60GsemSuocT9LYbNVZryhd-k1SxSlw0JpA4XdQhmAmh7gBMyEZstgfUWr40PXl4_vO_lc7pxtxv-H-AjtZE9M>53268</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Dead std::stack/std::deque is not being eliminated
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
An unused `std::stack` object with the default `std::deque` backend is not being eliminated. This is also true for GCC - see https://godbolt.org/z/749EGxjx1.
If you change the backend to `std::vector` it will be completely eliminated in Clang even if you pushed data into it. GCC will only completely eliminate it if it doesn't contain any data - see https://godbolt.org/z/fsacae58z.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNklGPmzAMxz8NvFiHIECBBx66dnfa-75AQgzkliYdcdrrffoZqtPW0yZNMiHG5u-f4yivb_3eQXQxoIZklwfSSblnCySHH_wBvHrFgeBqaAaaETSOMlp6SNb4M-KarPgndBpMAOcJFBo3AVpzMk4S6gy-zxxikzZ4oCUijH6Bl8MBniAgwkx0DquoeGabvFbeUuaXib13fpqq-_ry9vpWZEl-TPL9ff02ws1HGGbpJtwoP0DIP4BeuBW_rKRmbclaRoTBn84WCe3tD1QwDg5WrvgXdGDuFc4xzBzTkiQnsLihbKPftLxjib-prdVYgVftMbhENMR5jiQXke521_u_AxiDHCTW7XuW6r7UXdnJlAxZ7I8oNXyan3h-nNG_BpPGxfafSvPAo8q4HXasvXy8ns6LX28EuyaEiIE3dSl2bTr3leqaIu-qVhVq15VD06i2zMVQdm2xK4VMrVRoQ5_UXxIhHF5hk-B9Uh9T04tciLwo2qIu8qrNuqbTVT3WVaPVODZlUuV4ksZmK8d6JunSb0gqToGD1gQKv4MyBDM5xK0c68tIs1_60Sx4lRdMt9r9xv4LKwX-IQ">