From: Guillaume Gomez Date: Mon, 1 Mar 2021 23:50:11 +0000 (+0100) Subject: Rollup merge of #82676 - dtolnay:powers, r=Mark-Simulacrum X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=9a0ac7cb5feed93eb0b05468c07c2bb8cdea234b;p=rust.git Rollup merge of #82676 - dtolnay:powers, r=Mark-Simulacrum Change twice used large const table to static This table is used twice in core::num::dec2flt::algorithm::power_of_ten. According to the semantics of const, a separate huge definition of the table is inlined at both places. https://github.com/rust-lang/rust/blob/5233edcf1c7ee70ac25e4ec1115c3546f53d8a2d/library/core/src/num/dec2flt/algorithm.rs#L16-L22 Theoretically this gets cleaned up by optimization passes, but in practice I am experiencing a miscompile from LTO on this code. Making the table a static, which would only be defined a single time and not require attention from LTO, eliminates the miscompile and seems semantically more appropriate anyway. A separate bug report on the LTO bug is forthcoming. Original addition of `const` is from #27307. --- 9a0ac7cb5feed93eb0b05468c07c2bb8cdea234b