https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107801

--- Comment #5 from jdx at o2 dot pl ---
(In reply to CVS Commits from comment #4)
> The releases/gcc-12 branch has been updated by Jonathan Wakely
> <r...@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:691012693aaa831e4cd1ab5180195792e32baceb
> 
> commit r12-8926-g691012693aaa831e4cd1ab5180195792e32baceb
> Author: Jonathan Wakely <jwak...@redhat.com>
> Date:   Tue Nov 22 09:53:36 2022 +0000
> 
>     libstdc++: Fix pool resource build errors for H8 [PR107801]
>     
>     The array of pool sizes was previously adjusted to work for msp430-elf
>     which has 16-bit int and either 16-bit size_t or 20-bit size_t. The
>     largest pool sizes were disabled unless size_t has more than 20 bits.
>     
>     The H8 family has 16-bit int but 32-bit size_t, which means that the
>     largest sizes are enabled, but 1<<15 produces a negative number that
>     then cannot be narrowed to size_t.

Jonathan,
a bit of explanation regarding H8 family – it has a few "subfamilies":

1. H8/300 and H8/300L (L from "low power" AFAIR) – these are pure 16-bit MCUs,
it has 16-bit general purpose registers, sizeof(int) = sizeof(size_t) = 2;
AFAIK they are not manufactured anymore; I have never used any of them.

2. H8/300H, H8S and H8SX – Renesas/Hitachi calls them 16-bit but I call them
quasi 32-bit MCUs because they have 32-bit GPRs and instructions, although data
bus width is 16 bit. Here things are more complicated – sizeof(size_t) = 4 but
sizeof(int) may be  2 or 4 depending on -mint32 command line option. To get
things even more complicated, these MCUs have also so called "normal mode" (-mn
option) – it is compatibility mode with H8/300 and obviously in this mode
sizeof(int) = sizeof(size_t) = 2; __NORMAL_MODE__ macro is defined in this
mode.

Reply via email to