diff options
author | Lewis Hyatt <lhyatt@gmail.com> | 2024-11-16 13:45:22 -0500 |
---|---|---|
committer | Lewis Hyatt <lhyatt@gcc.gnu.org> | 2024-12-08 10:32:27 -0500 |
commit | d9cdc500c1e86b1218a24d1e8469930f000528d0 (patch) | |
tree | 2573b64fad706dc569ef3103e7704c5099f06f95 /libcpp/include/cpplib.h | |
parent | 89d19ab91a167c4c2258cc6c9fa7dd448c007ab7 (diff) | |
download | gcc-d9cdc500c1e86b1218a24d1e8469930f000528d0.zip gcc-d9cdc500c1e86b1218a24d1e8469930f000528d0.tar.gz gcc-d9cdc500c1e86b1218a24d1e8469930f000528d0.tar.bz2 |
Support for 64-bit location_t: Activate 64-bit location_t
Change location_t to be a 64-bit integer instead of a 32-bit integer in
libcpp.
Also included in this change are the two other patches in the original
series which depended on this one; I am committing them all at once in case
it needs to be reverted later:
-Support for 64-bit location_t: gimple parts
The size of struct gimple increased by 8 bytes with the change in size of
location_t from 32- to 64-bit; adjust the WORD markings in the comments
accordingly. It seems that most of the WORD markings were off by one already,
probably not having been updated after a previous reduction in the size of a
gimple, so they have become retroactively correct again, and only a couple
needed adjustment actually.
Also add a comment that there is now 32 bits of unused padding available in
struct gimple for 64-bit hosts.
-Support for 64-bit location_t: Remove -flarge-source-files
The option -flarge-source-files became unnecessary with 64-bit location_t
and harms performance compared to the new default setting, so silently
ignore it.
libcpp/ChangeLog:
* include/cpplib.h (struct cpp_token): Adjust comment about the
struct size.
* include/line-map.h (location_t): Change typedef from 32-bit to 64-bit
integer.
(LINE_MAP_MAX_COLUMN_NUMBER): Increase size to be appropriate for
64-bit location_t.
(LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES): Likewise.
(LINE_MAP_MAX_LOCATION_WITH_COLS): Likewise.
(LINE_MAP_MAX_LOCATION): Likewise.
(MAX_LOCATION_T): Likewise.
(line_map_suggested_range_bits): Likewise.
(struct line_map): Adjust comment about the struct size.
(struct line_map_macro): Likewise.
(struct line_map_ordinary): Likewise. Rearrange fields to optimize
padding.
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/pr77949.C: Adapt the test for 64-bit location_t,
when the previously expected failure doesn't actually happen.
* g++.dg/modules/loc-prune-4.C: Adjust the expected output for the
64-bit location_t case.
* gcc.dg/plugin/expensive_selftests_plugin.cc: Don't try to test
the maximum supported column number in 64-bit location_t mode.
* gcc.dg/plugin/location_overflow_plugin.cc: Adjust the base_location
so it can effectively test 64-bit location_t.
gcc/ChangeLog:
* gimple.h (struct gphi): Update word marking comments to reflect
the new size of location_t.
(struct gimple): Likewise. Add a comment about padding.
* common.opt: Mark -flarge-source-files as Ignored.
* common.opt.urls: Regenerate.
* doc/invoke.texi: Remove -flarge-source-files.
* toplev.cc (process_options): Remove support for
-flarge-source-files.
Diffstat (limited to 'libcpp/include/cpplib.h')
-rw-r--r-- | libcpp/include/cpplib.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 298b434..10f0725 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -255,8 +255,10 @@ struct GTY(()) cpp_identifier { spelling; }; -/* A preprocessing token. This has been carefully packed and should - occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts. */ +/* A preprocessing token. This occupies 32 bytes on a 64-bit host. On a + 32-bit host it occupies 20 or 24 bytes, depending whether a uint64_t + requires 4- or 8-byte alignment. */ + struct GTY(()) cpp_token { /* Location of first char of token, together with range of full token. */ |