On Mon, 18 Dec 2023, Jakub Jelinek wrote:

> On Mon, Dec 18, 2023 at 03:08:49PM +0100, Richard Biener wrote:
> > The following improves the manual work needed to make a -gimple dump
> > valid input to the GIMPLE FE.  First of all it recognizes the 'sizetype'
> > tree and dumps it as __SIZETYPE__, then it changes dumping vector types
> > without name from 'vector(n) T' to 'T [[gnu::vector_size(n')]]' which
> > we can parse in most relevant contexts (and that's shorter than
> > using __attribute__).  Third it avoids a NULL_TREE TMR_STEP when
> > it would be one, an optimization that's re-done when generating RTL.
> 
> Should we care that with -pedantic/-pedantic-errors it can be rejected
> then before -std=c23?

Probably not, you need to use -fgimple when compiling anyway.

>  We could print also __extension__ before the element
> type, but not sure if it would be the right spot in all cases.

Adding __extension__ would make using __attribute__((vectors_size(N)))
shorter.

I'm still thinking of how to lessen the most annoying pain WRT
-gimple dumping - the lack of global variable (and type) declarations.
The current plan is to have a global hash-map with used/dumped
non-local types and decls and incrementally handle them as
preamble for dump_function_to_file.

Of course that doesn't help with anonymous types which is what the
vector patch is for.  We also have quite some

 <unnamed-unsigned:17> _1;

stuff that's even impossible to work around.  But as always IMHO
incrementally improving GIMPLE FE things makes most sense.

> Otherwise LGTM.

Thanks,
Richard.

Reply via email to