aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorLewis Hyatt <lhyatt@gmail.com>2022-09-07 09:33:26 -0400
committerLewis Hyatt <lhyatt@gmail.com>2022-09-08 08:20:29 -0400
commit95c7d5899521a9e266c68cbcc92edfd2cde8694e (patch)
tree192d1b178bce8740d99ed7cb237c0810797d9b94 /gcc
parentf25a6767ec28780a3e3b6d38f5e54e1122a26fd6 (diff)
downloadgcc-95c7d5899521a9e266c68cbcc92edfd2cde8694e.zip
gcc-95c7d5899521a9e266c68cbcc92edfd2cde8694e.tar.gz
gcc-95c7d5899521a9e266c68cbcc92edfd2cde8694e.tar.bz2
pch: Fix the reconstruction of adhoc data hash table
The function rebuild_location_adhoc_htab() was meant to reconstruct the adhoc location hash map after restoring a line_maps instance from a PCH. However, the function has never performed as intended because it missed the last step of adding the data into the newly reconstructed hash map. This patch fixes that. It does not seem possible to construct a test case such that the current incorrect behavior is observable as a compiler issue. It would be observable, if it were possible for a precompiled header to contain an adhoc location with a non-zero custom data pointer. But currently, such data pointers are used only by the middle end to track inlining information, and this happens later, too late to show up in a PCH. I also noted that location_adhoc_data_update, which updates the hash map pointers in a different scenario, was relying on undefined pointer arithmetic behavior. I'm not aware of this having caused any issue in practice, but in this patch I have also changed it to use defined pointer operations instead. libcpp/ChangeLog: * line-map.cc (location_adhoc_data_update): Remove reliance on undefined behavior. (get_combined_adhoc_loc): Likewise. (rebuild_location_adhoc_htab): Fix issue where the htab was not properly updated.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions