On Wed, Oct 15, 2025 at 02:15:39PM +0200, Richard Biener wrote:
> > In v1 of this patch [1], I asked [2] the same thing, and the consensus
> > seem to have been that we should look at modes precisely to only work on
> > packed boolean vectors (TYPE_PRECISION of 1 bit is true for them but it
> > also true for other types).
>
> Which "other" VECTOR_BOOLEAN_TYPE_P types you mean? Note not all
> VECTOR_BOOLEAN_TYPE_P types have 1-bit element precision.
>
> I'll note that types is what users write and DWARF is supposed to
> represent source. Modes are an implementation detail, and in
> particular those might change between functions, for example to
> BLKmode if not supported.
Yeah, but we don't allow typedef bool VB __attribute__((vector_size (N)));
and even decltype (vect1 == vect2) in C++ (or typeof in C) will not be
VECTOR_BOOLEAN_TYPE_P I think, so I think one can see VECTOR_BOOLEAN_TYPE_P
in dwarf2out.cc hopefully only for the backend special types like aarch64
or riscv have.
And at that point, I think it is probably fine to use TYPE_MODE_RAW if it
will be always MODE_VECTOR_BOOL in those cases and derive generically the
debug info properties from that instead of having a target hook that needs
to do that for each target.
Jakub