about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2021-02-28 23:51:30 -0800
committerDavid Tolnay <dtolnay@gmail.com>2021-03-01 10:41:16 -0800
commitbd51dea6934d5c583fe9c8bc806e6287cac43f90 (patch)
treeec469a4d71b592f20362607c4d738848fe8e61de /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
parent3b150b7a8f77874f26c617666f5608fe4a3e58df (diff)
downloadrust-bd51dea6934d5c583fe9c8bc806e6287cac43f90.tar.gz
rust-bd51dea6934d5c583fe9c8bc806e6287cac43f90.zip
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.

    fn power_of_ten(e: i16) -> Fp {
        assert!(e >= table::MIN_E);
        let i = e - table::MIN_E;
        let sig = table::POWERS.0[i as usize];
        let exp = table::POWERS.1[i as usize];
        Fp { f: sig, e: exp }
    }

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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions