This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improve PR30911 and PR31023, Ada and VRP


On Sat, 29 Mar 2008, Eric Botcazou wrote:

> > This improves PR31023 by not folding comparisons as sign-changing
> > just because we convert from a integral sub-type to its base-type
> > as this also results in comparisons in a sub-type (similar to
> > arithmetic in sub-types) and eventually constants that are not in
> > the range of their types min/max value.
> 
> Thanks for your work in this area.
> 
> > With this fixed we can remove most of the range checking code
> > that Ada emits for the testcase in PR30911 if we pre-seed
> > parameter value-ranges in VRP with their types range.  This
> > should be immune against other bugs in fold and safe as Ada
> > ensures parameters are in range by checking code at the caller
> > site.
> 
> The latter assertion is not true for GNAT and, consequently, you cannot 
> pre-seed parameter ranges like that.

Ok, I'll apply the fold fix only then.

> Here's an excerpt of a discussion we had internally a couple of years ago:

[... discussion snipped ...]

That effectively means that the subtypes do not carry any useful
information for the middle-end.  Thus I propose to eliminate them
from the middle-end basically "lowering" all of them to their
base type.  This will make all of the issues with them magically
go away, simplifying the IL and improving maintainability and
understandability of the GCC middle-end.

Thanks,
Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]