Hi, On Wed, Jan 10 2024, Jakub Jelinek wrote: > Hi! > > As changed in other parts of the compiler, using > build_nonstandard_integer_type is not appropriate for arbitrary precisions, > especially if the precision comes from a BITINT_TYPE or something based on > that, build_nonstandard_integer_type relies on some integral mode being > supported that can support the precision. > > The following patch uses build_bitint_type instead for BITINT_TYPE > precisions. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Note, it would be good if we were able to punt on the optimization > (but this code doesn't seem to be able to punt, so it needs to be done > somewhere earlier) at least in cases where building it would be invalid. > E.g. right now BITINT_TYPE can support precisions up to 65535 (inclusive), > but 65536 will not work anymore (we can't have > 16-bit TYPE_PRECISION). > I've tried to replace 513 with 65532 in the testcase and it didn't ICE, > so maybe it ran into some other SRA limit.
Thank you very much for the patch. Regarding punting, did you mean for all BITINT_TYPEs or just for big ones, like you did when you fixed PR 11333 (thanks for that too) or something entirely else? Martin > > 2024-01-10 Jakub Jelinek <ja...@redhat.com> > > PR tree-optimization/113120 > * tree-sra.cc (analyze_access_subtree): For BITINT_TYPE > with root->size TYPE_PRECISION don't build anything new. > Otherwise, if root->type is a BITINT_TYPE, use build_bitint_type > rather than build_nonstandard_integer_type. > > * gcc.dg/bitint-63.c: New test.