public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107801] Building cross compiler for H8 family fails in libstdc++ (c++17/memory_resource.cc) Date: Tue, 16 May 2023 16:16:35 +0000 [thread overview] Message-ID: <bug-107801-4-6RFa42vm0p@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107801-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107801 --- Comment #20 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:23e12322bc03065557d9c0ee238b5b8d7b605c02 commit r11-10777-g23e12322bc03065557d9c0ee238b5b8d7b605c02 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon Nov 28 13:28:53 2022 +0000 libstdc++: Fix src/c++17/memory_resource for H8 targets [PR107801] This fixes compilation failures for H8 multilibs. For the normal multilib (ILP16L32?), the chunk struct does not have the expected size, because uint32_t is type long and has alignment 4 (by default). This forces sizeof(chunk) to be 12 instead of the expected 10. We can fix that by using bitset::size_type instead of uint32_t, so that we only use a 16-bit size when size_t and pointers are 16-bit types. For the IL32P16 multilibs that use -mint32, int is wider than size_t and so arithmetic expressions involving size_t promote to int. This means we need some explicit casts back to size_t. libstdc++-v3/ChangeLog: PR libstdc++/107801 * src/c++17/memory_resource.cc (chunk::_M_bytes): Change type from uint32_t to bitset::size_type. Adjust static assertion. (__pool_resource::_Pool::replenish): Cast to size_t after multiplication instead of before. (__pool_resource::_M_alloc_pools): Ensure both arguments to std::max have type size_t. (cherry picked from commit 75e562d2c4303d3918be9d1563284b0c580c5e45)
next prev parent reply other threads:[~2023-05-16 16:16 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-22 4:56 [Bug libstdc++/107801] New: " jdx at o2 dot pl 2022-11-22 9:08 ` [Bug libstdc++/107801] " redi at gcc dot gnu.org 2022-11-22 9:10 ` redi at gcc dot gnu.org 2022-11-22 9:20 ` redi at gcc dot gnu.org 2022-11-22 10:39 ` cvs-commit at gcc dot gnu.org 2022-11-22 11:06 ` cvs-commit at gcc dot gnu.org 2022-11-22 17:05 ` jdx at o2 dot pl 2022-11-22 17:09 ` redi at gcc dot gnu.org 2022-11-23 5:16 ` jdx at o2 dot pl 2022-11-26 21:41 ` pinskia at gcc dot gnu.org 2022-11-27 2:31 ` jdx at o2 dot pl 2022-11-27 7:35 ` redi at gcc dot gnu.org 2022-11-28 12:10 ` redi at gcc dot gnu.org 2022-11-28 13:32 ` redi at gcc dot gnu.org 2022-11-28 16:57 ` cvs-commit at gcc dot gnu.org 2022-11-28 17:01 ` redi at gcc dot gnu.org 2022-11-30 0:42 ` jdx at o2 dot pl 2022-11-30 1:48 ` redi at gcc dot gnu.org 2022-12-04 11:59 ` jdx at o2 dot pl 2023-05-16 12:50 ` cvs-commit at gcc dot gnu.org 2023-05-16 15:37 ` cvs-commit at gcc dot gnu.org 2023-05-16 16:16 ` cvs-commit at gcc dot gnu.org [this message] 2023-05-16 16:17 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107801-4-6RFa42vm0p@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).