diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-04 08:11:06 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-04 08:11:06 +0000 |
commit | 4ef59173eb76ddbef044b8db949378a6af004970 (patch) | |
tree | d5e9d4f4cf07bc195919c93c8bf9847eb413ac21 /gcc/ada/s-fatgen.ads | |
parent | e00420a65724457eda04f056f4d38454b6d9c68d (diff) | |
download | gcc-4ef59173eb76ddbef044b8db949378a6af004970.tar.gz |
2014-08-04 Thomas Quinot <quinot@adacore.com>
* s-fatgen.ads, s-fatgen.adb (S, P): New visible type declarations
(Unaligned_Valid): Remove now unused subprogram.
* exp_attr.adb (Expand_N_Attribute_Reference, case
Attribute_Valid): If the prefix is in reverse SSO or potentially
unaligned, copy it using a byte copy operation to a temporary
variable.
* einfo.adb: Minor comment fix.
2014-08-04 Hristian Kirtchev <kirtchev@adacore.com>
* freeze.adb (Freeze_Entity): Do not freeze formal subprograms.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213540 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-fatgen.ads')
-rw-r--r-- | gcc/ada/s-fatgen.ads | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/gcc/ada/s-fatgen.ads b/gcc/ada/s-fatgen.ads index 6c4e6f7b508..d8d761eaaed 100644 --- a/gcc/ada/s-fatgen.ads +++ b/gcc/ada/s-fatgen.ads @@ -94,24 +94,18 @@ package System.Fat_Gen is -- be an abnormal value that cannot be passed in a floating-point -- register, and the whole point of 'Valid is to prevent exceptions. -- Note that the object of type T must have the natural alignment - -- for type T. See Unaligned_Valid for further discussion. - - function Unaligned_Valid (A : System.Address) return Boolean; - -- This version of Valid is used if the floating-point value to - -- be checked is not known to be aligned (for example it appears - -- in a packed record). In this case, we cannot call Valid since - -- Valid assumes proper full alignment. Instead Unaligned_Valid - -- performs the same processing for a possibly unaligned float, - -- by first doing a copy and then calling Valid. One might think - -- that the front end could simply do a copy to an aligned temp, - -- but remember that we may have an abnormal value that cannot - -- be copied into a floating-point register, so things are a bit - -- trickier than one might expect. - -- - -- Note: Unaligned_Valid is never called for a target which does - -- not require strict alignment (e.g. the ia32/x86), since on a - -- target not requiring strict alignment, it is fine to pass a - -- non-aligned value to the standard Valid routine. + -- for type T. + + type S is new String (1 .. T'Size / Character'Size); + type P is access all S with Storage_Size => 0; + -- Buffer and access types used to initialize temporaries for validity + -- checks, if the value to be checked has reverse scalar storage order, or + -- is not known to be properly aligned (for example it appears in a packed + -- record). In this case, we cannot call Valid since Valid assumes proper + -- full alignment. Instead, we copy the value to a temporary location using + -- type S (we cannot simply do a copy of a T value, because the value might + -- be invalid, in which case it might not be possible to copy it through a + -- floating point register). private pragma Inline (Machine); |