This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE(Ada RFC)
- From: Robert Dewar <dewar at adacore dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: fw at deneb dot enyo dot de, gcc at gcc dot gnu dot org
- Date: Fri, 12 Aug 2005 12:12:32 -0400
- Subject: Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE(Ada RFC)
- References: <10508121601.AA14596@vlsi1.ultra.nyu.edu>
Richard Kenner wrote:
> Well sure, reading an uninitialized value is erroneous except for the use
> of 'Valid.
No, it's not, as Ada is not C.
What's "not"? My statement is based on the Ada RM.
the rm is quite clear, lack of initialization
never leads to erroneous behavior. an uninitialized
variable may have an invalid value, but is not
abnormal. For example it is not a valid
implementation for
a(i) := 0;
to overwrite memory outside the array a when
i is uninitialized, a validity check is
required here. same thing with case
statements.
And please note the presence of pragma Normalize_Scalars.
That doesn't affect validity or erroneousness.
the progrm is not erroneous in either case