Before this patch, the machinery to generate validity checks got
confused in some situations involving private views of types, and ended
up generating incorrect conversions from floating point types to integer
types. This patch fixes this.
gcc/ada/ChangeLog:
* exp_attr.adb (Expand_N_Attribute_Reference): Fix computation of type
category.
-- Floating-point case. This case is handled by the Valid attribute
-- code in the floating-point attribute run-time library.
- if Is_Floating_Point_Type (Ptyp) then
+ if Is_Floating_Point_Type (PBtyp) then
Float_Valid : declare
Pkg : RE_Id;
Ftp : Entity_Id;
-- Start of processing for Float_Valid
begin
- Find_Fat_Info (Ptyp, Ftp, Pkg);
+ Find_Fat_Info (PBtyp, Ftp, Pkg);
-- If the prefix is a reverse SSO component, or is possibly
-- unaligned, first create a temporary copy that is in