> Am 18.05.2023 um 19:44 schrieb Eric Botcazou <botca...@adacore.com>: > > >> >> Would it be better to use >> >> wi::to_uhwi (wi::to_wide (local->index) - wi::to_wide (local->min_index)) >> >> to honor the actual sign of the indices? I think nothing forbids frontends >> to use a signed TYPE_DOMAIN here? But the difference should be always >> representable in an unsigned value of course. > > We use tree_to_uhwi everywhere else though, see categorize_ctor_elements_1: > > if (tree_fits_uhwi_p (lo_index) && tree_fits_uhwi_p (hi_index)) > mult = (tree_to_uhwi (hi_index) > - tree_to_uhwi (lo_index) + 1); > > or store_constructor > > this_node_count = (tree_to_uhwi (hi_index) > - tree_to_uhwi (lo_index) + 1); > > so the proposed form looks better for the sake of consistency. Ok, thanks for checking. Richard > -- > Eric Botcazou > >
Re: [PATCH] Fix internal error on small array with negative lower bound
Richard Biener via Gcc-patches Thu, 18 May 2023 11:25:11 -0700
- [PATCH] Fix internal error on small array w... Eric Botcazou via Gcc-patches
- Re: [PATCH] Fix internal error on smal... Richard Biener via Gcc-patches
- Re: [PATCH] Fix internal error on ... Eric Botcazou via Gcc-patches
- Re: [PATCH] Fix internal error... Richard Biener via Gcc-patches