summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-ngcoty.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:21:30 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-13 10:21:30 +0000
commitf0bf2ff3403caee421ee10111f0d94ba8b70868a (patch)
treefe74bc1bf6eab08387b00192686ada41e98ef0ea /gcc/ada/a-ngcoty.adb
parentd03308df6e185f691bb854d38e1e3b3a8198ce1a (diff)
downloadppe42-gcc-f0bf2ff3403caee421ee10111f0d94ba8b70868a.tar.gz
ppe42-gcc-f0bf2ff3403caee421ee10111f0d94ba8b70868a.zip
2007-12-06 Robert Dewar <dewar@adacore.com>
Ed Schonberg <schonberg@adacore.com> * a-ngcoty.adb: New pragma Fast_Math * opt.adb: New pragma Fast_Math * par-prag.adb: Add Implemented_By_Entry to the list of pragmas which do not require any special processing. (Favor_Top_Level): New pragma. New pragma Fast_Math * exp_attr.adb: Move Wide_[Wide_]Image routines to Exp_Imgv (Expand_N_Attribute_Reference, Displace_Allocator_Pointer, Expand_Allocator_Expression): Take into account VM_Target (Expand_Attribute, case 'Identity): Handle properly the case where the prefix is a task interface. New pragma Fast_Math * par.adb (Next_Token_Is): New function (P_Pragma): Add Skipping parameter (U_Left_Paren): New procedure (U_Right_Paren): New procedure New pragma Fast_Math * par-ch10.adb (P_Subunit): Unconditional msg for missing ) after subunit New pragma Fast_Math * sem_prag.adb: Add significance value to table Sig_Flag for pragma Implemented_By_Entry. (Analyze_Pragma): Add case for Ada 2005 pragma Implemented_By_Entry. (Set_Inline_Flags): Do not try to link pragma Inline onto chain of rep items, since it can apply to more than one overloadable entity. Set new flag Has_Pragma_Inline_Always for Inline_Always case. (Analyze_Pragma, case Complex_Representation): Improve error message. (Analyze_Pragma, case Assert): When assertions are disabled build the rewritten code with Sloc of expression rather than pragma, so new warning about failing is not deleted. (Analyze_Pragma): Allow pragma Preelaborable_Initialization to apply to protected types and update error message to reflect that. Test whether the protected type is allowed for the pragma (an error is issued if the type has any entries, or components that do not have preelaborable initialization). New pragma Fast_Math (Analyze_Pragma, case No_Return): Handle generic instance * snames.h, snames.ads, snames.adb: Add new predefined name for interface primitive _Disp_Requeue. New pragma Fast_Math * a-tags.ads, a-tags.adb: New calling sequence for String_To_Wide_[Wide_]String (Secondary_Tag): New subprogram. * exp_imgv.ads, exp_imgv.adb: Move Wide_[Wide_]Image routines here from Exp_Attr New calling sequence for String_To_Wide_[Wide_]String (Expand_Image_Attribute): Major rewrite. New calling sequence avoids the use of the secondary stack for image routines. * a-except-2005.adb, s-wchstw.ads, s-wchstw.adb, s-wwdenu.adb: New calling sequence for String_To_Wide_[Wide_]String * par-ch3.adb (P_Declarative_Items): Recognize use of Overriding in Ada 95 mode (P_Unknown_Discriminant_Part_Opt): Handle missing parens gracefully Remove Atree.Delete_Tree/Delete_Node and Nlist.Delete_List * par-ch6.adb (P_Subprogram): Recognize use of Overriding in Ada 95 mode (P_Formal_Part): Use Skipping parameter in P_Pragma call to improve error recovery * par-util.adb (Next_Token_Is): New function (Signal_Bad_Attribute): Use new Namet.Is_Bad_Spelling_Of function * par-ch2.adb (Skip_Pragma_Semicolon): Do not resynchronize to semicolon if missing (P_Pragma): Implement new Skipping parameter Remove Atree.Delete_Tree/Delete_Node and Nlist.Delete_List Fix location of flag for unrecognized pragma message * par-tchk.adb (U_Left_Paren): New procedure (U_Right_Paren): New procedure git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130818 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-ngcoty.adb')
-rw-r--r--gcc/ada/a-ngcoty.adb20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ada/a-ngcoty.adb b/gcc/ada/a-ngcoty.adb
index 548f2d671ee..502a47d15cc 100644
--- a/gcc/ada/a-ngcoty.adb
+++ b/gcc/ada/a-ngcoty.adb
@@ -52,16 +52,18 @@ package body Ada.Numerics.Generic_Complex_Types is
X := Left.Re * Right.Re - Left.Im * Right.Im;
Y := Left.Re * Right.Im + Left.Im * Right.Re;
- -- If either component overflows, try to scale
+ -- If either component overflows, try to scale (skip in fast math mode)
- if abs (X) > R'Last then
- X := R'(4.0) * (R'(Left.Re / 2.0) * R'(Right.Re / 2.0)
- - R'(Left.Im / 2.0) * R'(Right.Im / 2.0));
- end if;
+ if not Standard'Fast_Math then
+ if abs (X) > R'Last then
+ X := R'(4.0) * (R'(Left.Re / 2.0) * R'(Right.Re / 2.0)
+ - R'(Left.Im / 2.0) * R'(Right.Im / 2.0));
+ end if;
- if abs (Y) > R'Last then
- Y := R'(4.0) * (R'(Left.Re / 2.0) * R'(Right.Im / 2.0)
- - R'(Left.Im / 2.0) * R'(Right.Re / 2.0));
+ if abs (Y) > R'Last then
+ Y := R'(4.0) * (R'(Left.Re / 2.0) * R'(Right.Im / 2.0)
+ - R'(Left.Im / 2.0) * R'(Right.Re / 2.0));
+ end if;
end if;
return (X, Y);
@@ -143,7 +145,6 @@ package body Ada.Numerics.Generic_Complex_Types is
-- 1.0 / infinity, and the closest model number will be zero.
begin
-
while Exp /= 0 loop
if Exp rem 2 /= 0 then
Result := Result * Factor;
@@ -156,7 +157,6 @@ package body Ada.Numerics.Generic_Complex_Types is
return R'(1.0) / Result;
exception
-
when Constraint_Error =>
return (0.0, 0.0);
end;
OpenPOWER on IntegriCloud