This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Handling non-constant bounds in extract_range_from_cond
- From: Laurent GUERBY <laurent at guerby dot net>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Nov 2004 00:00:13 +0100
- Subject: Re: Handling non-constant bounds in extract_range_from_cond
- References: <10411292252.AA02269@vlsi1.ultra.nyu.edu>
On Mon, 2004-11-29 at 23:52, Richard Kenner wrote:
> Those tests are "if Element.Port_Number not in Port_Number_Type" and
>
> if Element.Port_Number < Port_Number_Type'First
> or Element.Port_Number > Port_Number_Type'Last
May be it's from Ada 83 code, it's exactly to safely (in the
presence of more aggressive optimizers) replace this
kind of code that 'Valid was added to Ada 95.
The Ada 95 Rationale has a very clear chapter on
this language feature:
http://www.adaic.org/standards/95rat/RAThtml/rat95-p3-h.html#1-1
Nothing will replace programmer training :).
I don't mind the compiler being friendler for "X in Foo"
(but then I assume some users may complain about performance
so you'll have to add a switch to restore the more formal standard
behaviour) but for 'Valid use, I really hope that no optimization will
be done by GCC (and without reading the standard
you're unlikely to find out about 'Valid which is
not that current in programming languages...).
Laurent