aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-02-23 11:56:17 +0100
committerRichard Biener <rguenther@suse.de>2023-02-24 16:41:36 +0100
commit2dd68cddbc745de2c4a4b4982673122716c8231c (patch)
tree2264d105a68d042dfa84ef637878e489323fcbe6 /gcc/fortran
parentef22c3e90b5010a5229e70907ad2087f774fdfc0 (diff)
downloadgcc-2dd68cddbc745de2c4a4b4982673122716c8231c.zip
gcc-2dd68cddbc745de2c4a4b4982673122716c8231c.tar.gz
gcc-2dd68cddbc745de2c4a4b4982673122716c8231c.tar.bz2
Avoid default-initializing auto_vec<T, N> storage, fix vec<vl_embed>
The following avoids default-initializing auto_vec storage for non-POD T since that's not what the allocated storage fallback will do and it's also not expected for existing cases like auto_vec<std::pair<unsigned, unsigned>, 64> elts; which exist to optimize the allocation. It also fixes the array accesses done by vec<vl_embed> to not use its own m_vecdata member but instead access the container provided storage via pointer arithmetic. * vec.h (vec<T, A, vl_embed>::m_vecdata): Remove. (vec<T, A, vl_embed>::m_vecpfx): Align as T to avoid changing alignment of vec<T, A, vl_embed> and simplifying address. (vec<T, A, vl_embed>::address): Compute as this + 1. (vec<T, A, vl_embed>::embedded_size): Use sizeof the vector instead of the offset of the m_vecdata member. (auto_vec<T, N>::m_data): Turn storage into uninitialized unsigned char. (auto_vec<T, N>::auto_vec): Allow allocation of one stack member. Initialize m_vec in a special way to avoid later stringop overflow diagnostics. * vec.cc (test_auto_alias): New. (vec_cc_tests): Call it.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions